使用QT / qmake编译libshout

时间:2010-09-03 16:42:27

标签: windows qt linker mingw qmake

我正在尝试将我的QT应用程序链接到DLL(libshout),同时为Windows构建。

我在.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

1 个答案:

答案 0 :(得分:0)

我的第一个猜测是libogg和libvorbis没有安装在/ local / lib中,你检查过它们在那里吗?