2010-09-03 59 views
0

我正在嘗試將我的QT應用程序鏈接到DLL(libshout),同時爲Windows構建。使用QT/qmake編譯libshout

我已經添加了相應的行到我的.pro文件:

LIBS += -L/local/lib -lmp3lame 
LIBS += -L/local/lib -lshout 
LIBS += -L/local/lib -logg 
LIBS += -L/local/lib -lvorbis 
LIBS += -lwsock32 

我也成功地構建和安裝libshout到/ local/lib目錄(我使用MinGW和gcc的-DW2編譯)。

但是,qmake無法成功鏈接。我在下面粘貼了gcc/make輸出。我甚至不確定它是否試圖鏈接到正確的庫(不是.a/.la是一個靜態庫?)。

我一直在撕裂我的頭髮了3天了這一個,所以任何幫助讚賞:)

g++-dw2 -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPP 
ORT -DQT_DLL -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CO 
RE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../Qt/4.6.3/include/QtCore' -I 
'../../Qt/4.6.3/include/QtNetwork' -I'../../Qt/4.6.3/include/QtGui' -I'../../Qt/ 
4.6.3/include/QtWebKit' -I'../../Qt/4.6.3/include' -I'../../Qt/4.6.3/include/Act 
iveQt' -I'release' -I'../../Qt/4.6.3/mkspecs/win32-g++' -o release/qrc_resources 
.o release/qrc_resources.cpp 
g++-dw2 -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo 
-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o build/release/MyApp.exe ob 
ject_script.MyApp.Release -L'c:/Qt/4.6.3/lib' -lmingw32 -lqtmain -L/local/lib - 
lmp3lame -L/local/lib -lshout -lwsock32 -lQtWebKit4 -lQtGui4 -lQtNetwork4 -lQtCo 
re4 
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `free_codec': 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:188: undefined reference to `ogg_ 
stream_clear' 
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `close_ogg': 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:144: undefined reference to `ogg_ 
sync_clear' 
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `send_ogg': 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:90: undefined reference to `ogg_s 
ync_buffer' 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:92: undefined reference to `ogg_s 
ync_wrote' 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:94: undefined reference to `ogg_s 
ync_pageout' 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:95: undefined reference to `ogg_p 
age_bos' 
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `open_codec': 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:154: undefined reference to `ogg_ 
page_serialno' 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:154: undefined reference to `ogg_ 
stream_init' 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:155: undefined reference to `ogg_ 
stream_pagein' 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:160: undefined reference to `ogg_ 
stream_clear' 
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `send_ogg': 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:117: undefined reference to `ogg_ 
page_serialno' 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:119: undefined reference to `ogg_ 
stream_pagein' 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:94: undefined reference to `ogg_s 
ync_pageout' 
C:/msys/1.0/local/lib/libshout.a(ogg.o): In function `shout_open_ogg': 
c:\myapp_app\external\libshout-2.2.2\src/ogg.c:74: undefined reference to `ogg_s 
ync_init' 
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `free_vorbis_data': 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:103: undefined reference to `v 
orbis_info_clear' 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:104: undefined reference to `v 
orbis_comment_clear' 
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `read_vorbis_page': 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:83: undefined reference to `vo 
rbis_synthesis_headerin' 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:82: undefined reference to `og 
g_stream_packetout' 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:91: undefined reference to `og 
g_stream_packetout' 
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `vorbis_blocksize': 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:110: undefined reference to `v 
orbis_packet_blocksize' 
C:/msys/1.0/local/lib/libshout.a(vorbis.o): In function `shout_open_vorbis': 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:57: undefined reference to `vo 
rbis_info_init' 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:58: undefined reference to `vo 
rbis_comment_init' 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:60: undefined reference to `og 
g_stream_packetout' 
c:\myapp_app\external\libshout-2.2.2\src/vorbis.c:62: undefined reference to `vo 
rbis_synthesis_headerin' 
collect2: ld returned 1 exit status 
make[1]: *** [build/release/Myapp.exe] Error 1 
make[1]: Leaving directory `/c/myapp_app/src' 
make: *** [release] Error 2 

回答

0

我的第一個猜想是,libogg和libvorbis未安裝在/ local/lib目錄,你檢查他們在那裏嗎?