2013-09-23 101 views
0

我在Windows 7(基本版)上安裝了以下兩個msi 64位—我從here下載了msi。如何使用MinGW構建gstreamer項目?

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

現在我試圖建立使用MinGW的(GCC 4.8.1)this 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未使用的參數-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-s dk/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-intl -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

這是什麼缺點?

我應該怎麼做才能解決這個問題?

+1

可能gstreamer本身,因爲'gst_init'不可用。 –

+0

@MarcB:不要安裝msi包含它?我沒有安裝什麼(或配置時錯過了)? – Nawaz

+0

你已經有'-lgstreamer-0.10'了,但只有當gstreamer的東西在include/linker路徑中時纔有用。 –

回答

2

我懷疑你正在使用MinGW的默認GCC編譯器,它的目標是x86架構,但是你已經下載了x86_64版本的SDK。鏈接器可以找到這些庫,但我將無法使用它們。

我們強烈建議使用cerbero的構建系統來設置開發環境。這將需要下載一個工作工具鏈的關懷和編譯所有的編譯依賴(自動工具,gettext的,libtoo,pkg配置,等...)

你會發現詳細說明here在部分建立一個單一的項目該SDK

簡而言之:

  1. 結賬cerbero的回購
  2. 運行與引導命令:./cerbero-uninstalled -c配置/ win64.cbc引導
  3. 進入開發shell:./cerbero-uninstalled -c config/win64。cbc shell