Results 1 to 8 of 8

Thread: compiling id3lib on windows Qt

  1. #1
    Join Date
    Apr 2010
    Posts
    2
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default compiling id3lib on windows Qt

    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 ?

  2. #2
    Join Date
    Mar 2010
    Location
    Belgium
    Posts
    14
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: compiling id3lib on windows Qt

    The syntax for win32 is different, unless you are cross-compiling :

    Qt Code:
    1. unix:LIBS += -L/usr/local/lib -lmath
    2. win32:LIBS += c:/mylibs/math.lib
    To copy to clipboard, switch view to plain text mode 
    (taken from Qt Assistant's qmake Variable Reference)

  3. #3
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: compiling id3lib on windows Qt

    Quote Originally Posted by Jarvis View Post
    The syntax for win32 is different, unless you are cross-compiling :

    Qt Code:
    1. unix:LIBS += -L/usr/local/lib -lmath
    2. win32:LIBS += c:/mylibs/math.lib
    To copy to clipboard, switch view to plain text mode 
    (taken from Qt Assistant's qmake Variable Reference)
    Option:
    Qt Code:
    1. LIBS += -lsomeLibrary
    To copy to clipboard, switch view to plain text mode 
    works also with win32.
    But, as you use MinGW then you might want an libid3lib.a file instead of id3lib.lib would be my guess. I'm not MinGW user, so I did not do it, but there are some tools to convert this, so search the net (you can start with this forum as it mentioned somewhere recently).

  4. The following user says thank you to faldzip for this useful post:

    harkon (19th April 2010)

  5. #4
    Join Date
    Mar 2010
    Location
    Belgium
    Posts
    14
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: compiling id3lib on windows Qt

    Damn, faldżip, you're right. I did not paid attention to mingw, an important detail.
    So yes, id3lib.lib and id3lib.dll must be libid3lib.a and libid3lib.dll.a.
    I don't have any hint for any converter.

  6. #5
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: compiling id3lib on windows Qt

    From some other forum thread:
    okay, do you have an libpq.a in your C:\Databases\PostgreSQL\8.4\lib?

    yes, i used reimp und dlltool for this

  7. The following user says thank you to faldzip for this useful post:

    harkon (19th April 2010)

  8. #6
    Join Date
    Dec 2009
    Posts
    18
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: compiling id3lib on windows Qt

    Hello

    For me and a lot of others beginners, could you post a step by step ?? I want to use the same library |

    Thank you

  9. #7
    Join Date
    Apr 2010
    Posts
    2
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: compiling id3lib on windows Qt

    Quote Originally Posted by giacomelli.fabio View Post
    Hello

    For me and a lot of others beginners, could you post a step by step ?? I want to use the same library |

    Thank you
    I tried, hardly, to converte, to compile, to engage the src code in my project, but without any sucess. Then, exhausted of trieds, i change. I´m now using TagLib (http://developer.kde.org/~wheeler/taglib.html) and my problems gone!

    but if you wanna try and show us the solution, follow some theorics options:

    Option 1) "reimp filename.lib", provided that the directory reimp.exe resides in is listed on the PATH environment variable and the command is given in the folder containing filename.lib.
    be sure that the dlltool.exe are in the same PATH enviroment.
    Option 2) "reimp -d filename.lib" and "dlltool --input-def lifename.def --dllname filename.dll --output-lib filename.a"
    Option 3) "pexports filename.dll > filename.def" and "dlltool -D filename.dll -d filename.def -l filename.a"
    Option 4) "nm filename.dll | grep " T _" | sed "s/.* T _//" >> filename.def" and "dlltool -D filename.dll -d filename.def -l filename.a"
    i see in some cases, the use of "sed "s/.* T _//"" between step one and two.


    May the force be with you

  10. #8
    Join Date
    Dec 2009
    Posts
    18
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: compiling id3lib on windows Qt

    Uhm I only need to read the tags ...
    Taglib or id3lib ... it's the same ...
    I will try with taglib .... I hope I will not need your help
    I'm a noob ....

    EDITED

    Ok ... could you post for me a small piece of your project (library and *.pro) ? I'm not able to compile by myself ....( msys ?? ) I found already compiled libraires from another project (clementine, qt apps) but I can't add them :
    Last edited by giacomelli.fabio; 26th April 2010 at 23:15. Reason: updated contents

Similar Threads

  1. Compiling wih phonon on windows
    By deca5423 in forum Installation and Deployment
    Replies: 1
    Last Post: 16th July 2009, 17:42
  2. Compiling in Windows
    By srohit24 in forum Newbie
    Replies: 4
    Last Post: 14th February 2009, 09:56
  3. Need help with compiling on Windows
    By Cruz in forum Newbie
    Replies: 4
    Last Post: 29th January 2009, 11:09
  4. compiling under windows's troubles
    By giusepped in forum Qt Programming
    Replies: 1
    Last Post: 30th October 2008, 16:27
  5. id3lib library problem
    By acix in forum General Programming
    Replies: 2
    Last Post: 11th April 2006, 13:46

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.