Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Including taglib in Qt project
QtWS25 Last Chance

Including taglib in Qt project

Scheduled Pinned Locked Moved Unsolved General and Desktop
taglibqt 5.6.0windows
4 Posts 2 Posters 2.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • GagiopapinniG Offline
    GagiopapinniG Offline
    Gagiopapinni
    wrote on last edited by A Former User
    #1

    Hi everyone ... I have some problems with including taglib into my qt project ... I have built taglib sources , so now i have libtag.a and libtag_c.a files .

    MAIN.CPP :

    #include <fileref.h>
    #include <tag.h>
    #include <tpropertymap.h>

    using namespace std;

    ...

    TagLib::FileRef f("Help!.mp3",true);
    

    ...

    PRO-FILE:
    ...

    LIBS += C:\Users\gagoq\Documents\Libraries\taglib\lib\libtag.a
    INCLUDEPATH += C:\Users\gagoq\Documents\Libraries\taglib\include\taglib

    COMPILE OUTPUT:

    18:44:32: Running steps for project untitled1...
    18:44:32: Configuration unchanged, skipping qmake step.
    18:44:32: Starting: "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe"
    C:/Qt/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/Users/gagoq/Documents/build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug'
    g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\untitled1 -I. -I..\Libraries\taglib\include\taglib -I........\Qt\5.6\mingw49_32\include -I........\Qt\5.6\mingw49_32\include\QtWidgets -I........\Qt\5.6\mingw49_32\include\QtGui -I........\Qt\5.6\mingw49_32\include\QtANGLE -I........\Qt\5.6\mingw49_32\include\QtCore -Idebug -I. -I........\Qt\5.6\mingw49_32\mkspecs\win32-g++ -o debug\main.o ..\untitled1\main.cpp
    g++ -Wl,-subsystem,windows -mthreads -o debug\untitled1.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -lmingw32 -LC:\Qt\5.6\mingw49_32\lib C:\Qt\5.6\mingw49_32\lib\libqtmaind.a -LC:\utils\postgresql\pgsql\lib -LC:\utils\my_sql\my_sql\lib -lshell32 C:\Users\gagoq\Documents\Libraries\taglib\lib\libtag.a C:\Qt\5.6\mingw49_32\lib\libQt5Widgetsd.a C:\Qt\5.6\mingw49_32\lib\libQt5Guid.a C:\Qt\5.6\mingw49_32\lib\libQt5Cored.a
    debug/main.o: In function Z5qMainiPPc': C:\Users\gagoq\Documents\build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../untitled1/main.cpp:18: undefined reference to _imp___ZN6TagLib8FileNameC1EPKc'
    C:\Users\gagoq\Documents\build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../untitled1/main.cpp:18: undefined reference to _imp___ZN6TagLib7FileRefC1ENS_8FileNameEbNS_15AudioProperties9ReadStyleE' Makefile.Debug:65: recipe for target 'debug\untitled1.exe' failed C:\Users\gagoq\Documents\build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../untitled1/main.cpp:18: undefined reference to _imp___ZN6TagLib7FileRefD1Ev'
    mingw32-make[1]: Leaving directory 'C:/Users/gagoq/Documents/build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug'
    makefile:34: recipe for target 'debug' failed
    C:\Users\gagoq\Documents\build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../untitled1/main.cpp:18: undefined reference to `_imp___ZN6TagLib7FileRefD1Ev'
    collect2.exe: error: ld returned 1 exit status
    mingw32-make[1]: *** [debug\untitled1.exe] Error 1
    mingw32-make: *** [debug] Error 2
    18:44:41: The process "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project untitled1 (kit: Desktop Qt 5.6.0 MinGW 32bit)
    When executing step "Make"
    18:44:41: Elapsed time: 00:10.

    so, what am i doing wrong ?

    kshegunovK 1 Reply Last reply
    0
    • GagiopapinniG Gagiopapinni

      Hi everyone ... I have some problems with including taglib into my qt project ... I have built taglib sources , so now i have libtag.a and libtag_c.a files .

      MAIN.CPP :

      #include <fileref.h>
      #include <tag.h>
      #include <tpropertymap.h>

      using namespace std;

      ...

      TagLib::FileRef f("Help!.mp3",true);
      

      ...

      PRO-FILE:
      ...

      LIBS += C:\Users\gagoq\Documents\Libraries\taglib\lib\libtag.a
      INCLUDEPATH += C:\Users\gagoq\Documents\Libraries\taglib\include\taglib

      COMPILE OUTPUT:

      18:44:32: Running steps for project untitled1...
      18:44:32: Configuration unchanged, skipping qmake step.
      18:44:32: Starting: "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe"
      C:/Qt/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
      mingw32-make[1]: Entering directory 'C:/Users/gagoq/Documents/build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug'
      g++ -c -pipe -fno-keep-inline-dllexport -g -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\untitled1 -I. -I..\Libraries\taglib\include\taglib -I........\Qt\5.6\mingw49_32\include -I........\Qt\5.6\mingw49_32\include\QtWidgets -I........\Qt\5.6\mingw49_32\include\QtGui -I........\Qt\5.6\mingw49_32\include\QtANGLE -I........\Qt\5.6\mingw49_32\include\QtCore -Idebug -I. -I........\Qt\5.6\mingw49_32\mkspecs\win32-g++ -o debug\main.o ..\untitled1\main.cpp
      g++ -Wl,-subsystem,windows -mthreads -o debug\untitled1.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -lmingw32 -LC:\Qt\5.6\mingw49_32\lib C:\Qt\5.6\mingw49_32\lib\libqtmaind.a -LC:\utils\postgresql\pgsql\lib -LC:\utils\my_sql\my_sql\lib -lshell32 C:\Users\gagoq\Documents\Libraries\taglib\lib\libtag.a C:\Qt\5.6\mingw49_32\lib\libQt5Widgetsd.a C:\Qt\5.6\mingw49_32\lib\libQt5Guid.a C:\Qt\5.6\mingw49_32\lib\libQt5Cored.a
      debug/main.o: In function Z5qMainiPPc': C:\Users\gagoq\Documents\build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../untitled1/main.cpp:18: undefined reference to _imp___ZN6TagLib8FileNameC1EPKc'
      C:\Users\gagoq\Documents\build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../untitled1/main.cpp:18: undefined reference to _imp___ZN6TagLib7FileRefC1ENS_8FileNameEbNS_15AudioProperties9ReadStyleE' Makefile.Debug:65: recipe for target 'debug\untitled1.exe' failed C:\Users\gagoq\Documents\build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../untitled1/main.cpp:18: undefined reference to _imp___ZN6TagLib7FileRefD1Ev'
      mingw32-make[1]: Leaving directory 'C:/Users/gagoq/Documents/build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug'
      makefile:34: recipe for target 'debug' failed
      C:\Users\gagoq\Documents\build-untitled1-Desktop_Qt_5_6_0_MinGW_32bit-Debug/../untitled1/main.cpp:18: undefined reference to `_imp___ZN6TagLib7FileRefD1Ev'
      collect2.exe: error: ld returned 1 exit status
      mingw32-make[1]: *** [debug\untitled1.exe] Error 1
      mingw32-make: *** [debug] Error 2
      18:44:41: The process "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
      Error while building/deploying project untitled1 (kit: Desktop Qt 5.6.0 MinGW 32bit)
      When executing step "Make"
      18:44:41: Elapsed time: 00:10.

      so, what am i doing wrong ?

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @Gagiopapinni
      Hello!

      LIBS += -LC:/Users/gagoq/Documents/Libraries/taglib/lib -ltag
      INCLUDEPATH += C:/Users/gagoq/Documents/Libraries/taglib/include/taglib
      PRE_TARGETDEPS += C:/Users/gagoq/Documents/Libraries/taglib/lib/libtag.a
      

      Also make sure you use the same compiler for building the static library and your application. As a side note I advise to always use forward slashes giving paths even on Windows and I personally prefer the *nix style linking switches.

      I hope that helps.
      Kind regards.

      Read and abide by the Qt Code of Conduct

      GagiopapinniG 1 Reply Last reply
      0
      • kshegunovK kshegunov

        @Gagiopapinni
        Hello!

        LIBS += -LC:/Users/gagoq/Documents/Libraries/taglib/lib -ltag
        INCLUDEPATH += C:/Users/gagoq/Documents/Libraries/taglib/include/taglib
        PRE_TARGETDEPS += C:/Users/gagoq/Documents/Libraries/taglib/lib/libtag.a
        

        Also make sure you use the same compiler for building the static library and your application. As a side note I advise to always use forward slashes giving paths even on Windows and I personally prefer the *nix style linking switches.

        I hope that helps.
        Kind regards.

        GagiopapinniG Offline
        GagiopapinniG Offline
        Gagiopapinni
        wrote on last edited by
        #3

        @kshegunov without results ... it is the same compiler (MinGW 32bit)

        kshegunovK 1 Reply Last reply
        0
        • GagiopapinniG Gagiopapinni

          @kshegunov without results ... it is the same compiler (MinGW 32bit)

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by
          #4

          @Gagiopapinni
          Okay, can you verify that this symbol is present in the static lib? (you could use "dependency walker" for that purpose)

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved