views:

66

answers:

1

I'm trying to link my QT application to a DLL (libshout), while building for Windows.

I've added the appropriate lines to my .pro file:

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

I've also successfully built and installed libshout to /local/lib (I'm using mingw and the gcc-dw2 compiler).

However, qmake fails to link successfully. I've pasted the gcc/make output below. I'm not even sure it's trying to link to the right library (isn't .a/.la a static library?).

I've been tearing my hair out for 3 days over this one so any help appreciated :)

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
A: 

My first guess would be that libogg and libvorbis aren't installed in /local/lib, did you check that they are there?

teukkam