PDA

View Full Version : Qt/windows: how to compile program with audiere library



punjabikura
9th October 2006, 08:17
I have the following setup:

Platform: Windows XP w/SP2
Compiler: Dev-cpp 4.9.9.2
Mingw/GCC: 3.4.2
Qt win32: 4.4.1

Qt uses the mingw compiler that came with dev-cpp ... it has been working perfectly and has been taking me through the learning curve without issues.

I am creating a project which requires the audiere library (http://audiere.sourceforge.net/) ... i downloaded the win32 version of audiere and tried to compile thier sample program called simple.

Audiere came with three files: audiere.dll, audiere.h, and audiere.lib
I put the dll under the system32 folder and copied the header file into the includes of devcpp and Qt's include folders ... but when it came to the .lib file ... the lib folders of devcpp and Qt had only .a files ...

So i tried compiling without doing anything to the .lib file but i got the following error during the make command:



mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `D:/Projects/simple'
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt
ime-pseudo-reloc -Wl,-s -Wl,-s -Wl,-subsystem,windows -o "release\simple.exe" re
lease\simple.o -L"c:\Programs\Qt\4.1.4\lib" -lmingw32 -lqtmain -lQtGui4 -lQtCor
e4
release\simple.o(.text+0xfc):simple.cpp: undefined reference to `_imp__AdrOpenDe
vice@8'
release\simple.o(.text+0x1cf):simple.cpp: undefined reference to `_imp__AdrOpenS
ampleSource@8'
release\simple.o(.text+0x55d):simple.cpp: undefined reference to `_imp__AdrOpenS
ampleSource@8'
release\simple.o(.text+0x5a5):simple.cpp: undefined reference to `_imp__AdrOpenS
ound@12'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\simple.exe] Error 1
mingw32-make[1]: Leaving directory `D:/Projects/simple'
mingw32-make: *** [release] Error 2

So i googled for what to do with the .lib, turns out it is very imp and so i tried looking up how to convert it to .a and came across the mingw utility called reimp (http://jrfonseca.planetaclix.pt/projects/gnu-win32/software/reimp/index.html).

I used that to conver the .lib file into .a and copied it to devcpp and Qt's lib folders and tried compiling but i got the same error again ....

now i have absolutely no idea how to continue? any help would be greatly apreciated!

Thankyou.
Punjabikura

munna
9th October 2006, 09:11
Try adding the following line in your .pro file :

LIBS += path to the library file

punjabikura
9th October 2006, 09:26
wow didnt think it was something of that nature ...

so this is what i did ... i added the line you suggested so my .pro looks like this now:


################################################## ####################
# Automatically generated by qmake (2.00a) Mon Oct 9 03:17:34 2006
################################################## ####################

TEMPLATE = app
TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
LIBS += -L"C:\Programs\Qt\4.1.4\lib" -llibaudiere

# Input
HEADERS += audiere.h
SOURCES += simple.cpp

before the way i was doing it ... this line :

LIBS += -L"C:\Programs\Qt\4.1.4\lib" -llibaudiere
was not in the .pro file at all ...

good thing is that it compiles and doesnt give any errors but just a few warnings ... bad thing is that it doesnt work properly ... maybe it was compiled badly, or the warnings did cause some change ... but basically its not running as it should ...

Compile log:

mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `D:/Projects/simple'
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_D
LL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
-I"C:/Programs/Qt/4.1.4/include/QtCore" -I"C:/Programs/Qt/4.1.4/include/QtGui"
-I"C:/Programs/Qt/4.1.4/include" -I"." -I"C:/Programs/Qt/4.1.4/include/ActiveQt"
-I"release" -I"." -I"c:\Programs\Qt\4.1.4\mkspecs\win32-g++" -o release\simple.
o simple.cpp
In file included from simple.cpp:5:
audiere.h:72: warning: `class audiere::RefCounted' has virtual functions but non
-virtual destructor
audiere.h:229: warning: `class audiere::File' has virtual functions but non-virt
ual destructor
audiere.h:306: warning: `class audiere::SampleSource' has virtual functions but
non-virtual destructor
audiere.h:425: warning: `class audiere::LoopPointSource' has virtual functions b
ut non-virtual destructor
audiere.h:478: warning: `class audiere::OutputStream' has virtual functions but
non-virtual destructor
audiere.h:595: warning: `class audiere::Event' has virtual functions but non-vir
tual destructor
audiere.h:610: warning: `class audiere::StopEvent' has virtual functions but non
-virtual destructor
audiere.h:640: warning: `class audiere::Callback' has virtual functions but non-
virtual destructor
audiere.h:668: warning: `class audiere::StopCallback' has virtual functions but
non-virtual destructor
audiere.h:696: warning: `class audiere::AudioDevice' has virtual functions but n
on-virtual destructor
audiere.h:786: warning: `class audiere::SampleBuffer' has virtual functions but
non-virtual destructor
audiere.h:839: warning: `class audiere::SoundEffect' has virtual functions but n
on-virtual destructor
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt
ime-pseudo-reloc -Wl,-s -Wl,-s -Wl,-subsystem,windows -o "release\simple.exe" re
lease\simple.o -L"c:\Programs\Qt\4.1.4\lib" -lmingw32 -lqtmain -L"C:\Programs\Q
t\4.1.4\lib" -llibaudiere -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `D:/Projects/simple'

any suggestions ?

zizoumgs
21st December 2009, 16:09
im success compile audiere plus Qt in window , but im failed in linux (ubuntu 8.10),
Any suggestion?