0

msi在我的 Windows 7(基本)64 位上安装了以下两个——我从这里下载了 msi 。

  • gstreamer-sdk-devel-x86_64-2013.6.msi
  • gstreamer-sdk-x86_64-2013.6.msi

现在我正在尝试使用 MinGW (GCC 4.8.1) 构建这个 hello world程序,而链接器给我带来了麻烦,说:

C:\Users\Apelles\AppData\Local\Temp\ccwLMXuu.o: In function `gst_message_unref':
C:/gstreamer-sdk/0.10/x86_64/include/gstreamer-0.10/gst/gstmessage.h:347: undefined reference to `gst_mini_object_unref'
C:\Users\Apelles\AppData\Local\Temp\ccwLMXuu.o: In function `main':
F:\projects\gstreamer/helloworld.c:9: undefined reference to `gst_init'
F:\projects\gstreamer/helloworld.c:12: undefined reference to `gst_parse_launch'
F:\projects\gstreamer/helloworld.c:15: undefined reference to `gst_element_set_state'
F:\projects\gstreamer/helloworld.c:18: undefined reference to `gst_element_get_bus'
F:\projects\gstreamer/helloworld.c:19: undefined reference to `gst_bus_timed_pop_filtered'
F:\projects\gstreamer/helloworld.c:24: undefined reference to `gst_object_unref'
F:\projects\gstreamer/helloworld.c:25: undefined reference to `gst_element_set_state'
F:\projects\gstreamer/helloworld.c:26: undefined reference to `gst_object_unref'
collect2.exe: error: ld returned 1 exit status

我错过了哪个库?

以下是我用来构建项目的选项(取自我的make输出):

gcc helloworld.c -ggdb -Wall -Wextra -ansi -std=c99 -Wno-unused-parameter -mms-bitfields -IC:/gstreamer-sdk/0.10/x86_64/include/gtk-2.0 -IC:/gstreamer-sdk /0.10/x86_64/lib/gtk-2.0/include -IC:/gstreamer-sdk/0.10/x86_64/include/atk-1.0 -IC:/gstreamer-sdk/0.10/x86_64/include/cairo -IC:/gstreamer- sdk/0.10/x86_64/include/gdk-pixbuf-2.0 -IC:/gstreamer-sdk/0.10/x86_64/include/pango-1.0 -IC:/gstreamer-sdk/0.10/x86_64/include/glib-2.0 -IC: /gstreamer-sdk/0.10/x86_64/lib/glib-2.0/include -IC:/gstreamer-sdk/0.10/x86_64/include/pixman-1 -IC:/gstreamer-sdk/0.10/x86_64/include/fontconfig -IC :/gstreamer-sdk/0.10/x86_64/include/freetype2 -IC:/gstreamer-sdk/0.10/x86_64/include -IC:/gstreamer-sdk/0.10/x86_64/include/libpng15 -mms-bitfields -IC:/gstreamer -sdk/0.10/x86_64/include/gstreamer-0.10 -IC:/gstreamer-sdk/0.10/x86_64/include/glib-2.0 -IC:/gstreamer-sdk/0。10/x86_64/lib/glib-2.0/include -IC:/gstreamer-sdk/0.10/x86_64/include/libxml2 -LC:/gstreamer-sdk/0.10/x86_64/lib -lgtk-win32-2.0 -lgdk-win32- 2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -lintl -LC:/gstreamer-sdk/0.10/x86_64 /lib -lgstinterfaces-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lxml2 -lglib-2.0 -lintl

这其中缺少什么?

我应该怎么做才能解决这个问题?

4

1 回答 1

3

我怀疑您使用的是针对 x86 架构的 MinGW 的默认 GCC 编译器,但您已经下载了 SDK 的 x86_64 版本。链接器可以找到这些库,但我无法使用它们。

我们强烈建议使用 cerbero 的构建系统来设置开发环境。它将负责下载工作工具链并编译所有构建依赖项(autotools、gettext、libtoo、pkg-config 等...)

您将在使用 SDK 构建单个项目部分中找到详细说明

简而言之:

  1. 结帐 cerbero 的回购
  2. 使用以下命令运行引导命令:./cerbero-uninstalled -c config/win64.cbc bootstrap
  3. 使用以下命令进入开发外壳:./cerbero-uninstalled -c config/win64.cbc shell
于 2013-10-17T01:10:00.923 回答