Hello!

I´m using Qt 4.6.2 under Windows XP. I use the complete Qt version with minGW, QtDesigner etc.
then i´m trying to compile a simple code using id3lib (a library to read mp3 informations). My simple code is:

#include <id3/tag.h>

void Principal:n_pushButton_3_clicked()
{
ID3_Tag HarkonTag;
HarkonTag.Link("cabelo.mp3");
}


id3lib website: http://id3lib.sourceforge.net

To compile this, i take the includes files from id3lib and put in c:\qt\2010.02.1\mingw\include and
i had downloaded a "binaries" version of id3lib that contains:

id3lib.dll (573.440 bytes)
id3lib.exp (107.544 bytes)
id3lib.lib (177.036 bytes)


i put this 3 files on c:\qt\2010.02.1\migw\lib, and add to my test.pro

LIBS += -lid3lib

running the "nm id3lib.lib" i get a lot similars of this:

id3lib.dll:
00000000 I .idata$4
00000000 I .idata$5
00000000 I .idata$6
00000000 T .text
00000000 T ??0ID3_Tag@@QAE@ABV0@@Z
U __IMPORT_DESCRIPTOR_id3lib
00000000 I __imp_??0ID3_Tag@@QAE@ABV0@@Z

id3lib.dll:
00000000 I .idata$4
00000000 I .idata$5
00000000 I .idata$6
00000000 T .text
00000000 T ??0ID3_Tag@@QAE@PBD@Z
U __IMPORT_DESCRIPTOR_id3lib
00000000 I __imp_??0ID3_Tag@@QAE@PBD@Z


Looking this and Doing some experiences: testing with the CL compiler, reading the id3lib source
and playing with codes, i suspect that the id3lib.lib call fuctions on id3lib.dll.

So the result of this is that compiling my code occurs this:


Starting: C:/Qt/2010.02.1/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/teste/Teste'
C:/Qt/2010.02.1/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/teste/Teste'
c:\Qt\2010.02.1\qt\bin\uic.exe principal.ui -o ui_principal.h
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\Qt\2010.02.1\qt\include\QtCore" -I"..\..\Qt\2010.02.1\qt\include\QtGui" -I"..\..\Qt\2010.02.1\qt\include\QtXml" -I"..\..\Qt\2010.02.1\qt\include" -I"..\..\Qt\2010.02.1\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\Qt\2010.02.1\qt\mkspecs\win32-g++" -o debug\main.o main.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\Qt\2010.02.1\qt\include\QtCore" -I"..\..\Qt\2010.02.1\qt\include\QtGui" -I"..\..\Qt\2010.02.1\qt\include\QtXml" -I"..\..\Qt\2010.02.1\qt\include" -I"..\..\Qt\2010.02.1\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\Qt\2010.02.1\qt\mkspecs\win32-g++" -o debug\principal.o principal.cpp
C:/Qt/2010.02.1/qt/bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\Qt\2010.02.1\qt\include\QtCore" -I"..\..\Qt\2010.02.1\qt\include\QtGui" -I"..\..\Qt\2010.02.1\qt\include\QtXml" -I"..\..\Qt\2010.02.1\qt\include" -I"..\..\Qt\2010.02.1\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\Qt\2010.02.1\qt\mkspecs\win32-g++" -D__GNUC__ -DWIN32 principal.h -o debug\moc_principal.cpp
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\Qt\2010.02.1\qt\include\QtCore" -I"..\..\Qt\2010.02.1\qt\include\QtGui" -I"..\..\Qt\2010.02.1\qt\include\QtXml" -I"..\..\Qt\2010.02.1\qt\include" -I"..\..\Qt\2010.02.1\qt\include\ActiveQt" -I"debug" -I"." -I"..\..\Qt\2010.02.1\qt\mkspecs\win32-g++" -o debug\moc_principal.o debug\moc_principal.cpp
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o debug\Teste.exe debug/main.o debug/principal.o debug/moc_principal.o -L"c:\Qt\2010.02.1\qt\lib" -lmingw32 -lqtmaind -lid3lib -lQtXmld4 -lQtGuid4 -lQtCored4
mingw32-make[1]: Leaving directory `C:/teste/Teste'
mingw32-make: Leaving directory `C:/teste/Teste'
debug/principal.o:C:\teste\Teste/principal.cpp:8: undefined reference to `ID3_Tag::ID3_Tag(char const*)'
debug/principal.o:C:\teste\Teste/principal.cpp:9: undefined reference to `ID3_Tag::Link(char const*, unsigned short)'
debug/principal.o:C:\teste\Teste/principal.cpp:9: undefined reference to `ID3_Tag::~ID3_Tag()'
debug/principal.o:C:\teste\Teste/principal.cpp:9: undefined reference to `ID3_Tag::~ID3_Tag()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\Teste.exe] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project Teste
When executing build step 'Make'


with or without the option "LIBS += -lid3lib" the result are the same. exactly the same error showed above.

i had tried to spread id3lib.dll in the "c:\teste\teste" and in "c:\teste\teste\debug", but no effect.

i tried too this code in linux via Qt, but there compiling and installing id3lib. on linux, worked OK, but the libid3.a depends of a libid3.so to compiles ok (this sounds similar to something ?)


And the question that cannot silence: How i do to compile my simple code in windows using id3lib ?