Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Taglib Library
QtWS25 Last Chance

Taglib Library

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
27 Posts 4 Posters 5.2k 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.
  • jsulmJ jsulm

    @lucas_1603 What is the exact file name of the lib?
    Also, $$PWD/taglib is a relative path - are you sure it is correct (you can check the linker output to see what exactly is passed to -L.

    Lucas_1603L Offline
    Lucas_1603L Offline
    Lucas_1603
    wrote on last edited by
    #11

    @jsulm I would like to describe more details for you to understand my problems clearly


    This is exactly what I have tried :

    After downloading taglib (version 1.11.1) from taglib.org, I built it with cmake and got a .dll and a .dll.a file. Then I brought taglib folder to where my Qt project folder is in and named it 'myTaglib' as this picture

    0_1568179046840_d68d612f-8fa6-4b6b-a3cd-6f08b865a89c-image.png

    When I go to 'myTaglib' folder, I'll get these items

    0_1568179174653_477fd0c0-2ce1-449c-9514-859557de7c2f-image.png
    Now jumping into .pro file, I tried to link to taglib:

    QT += quick multimedia core
    CONFIG += c++11
    INCLUDEPATH += $$PWD/myTaglib
    DEPENDPATH += $$PWD/myTaglib
    LIBS += -L$$PWD/myTaglib -ltag
    

    And in header file, I included necessary files and using namespace TagLib like this:

    #include <tag.h>
    #include <fileref.h>
    #include <mpeg/id3v2/id3v2tag.h>
    #include <mpeg/mpegfile.h>
    #include <mpeg/id3v2/id3v2frame.h>
    #include <mpeg/id3v2/id3v2header.h>
    #include <mpeg/id3v2/frames/attachedpictureframe.h>
    using namespace TagLib;
    

    After all, I built my project and got some errors:

    ...
    undefined reference to `__imp__ZN6TagLib8FileNameC1EPKc' in player.cpp - line 94
    undefined reference to `__imp__ZN6TagLib7FileRefC1ENS_8FileNameEbNS_15AudioProperties9ReadStyleE' in player.cpp - line 94
    undefined reference to `__imp__ZNK6TagLib7FileRef3tagEv' in player.cpp - line 95
    undefined reference to `__imp__ZNK6TagLib6String10toCWStringEv' in player.cpp - line 97
    undefined reference to `__imp__ZNK6TagLib6String10toCWStringEv' in player.cpp - line 96
    ...
    

    Then, I checked these lines but it didn't show something like underlined error or red text or something like that, you can see this picture

    0_1568179229760_05b4470b-fb3c-4c9c-a996-73498a0a3e5a-image.png

    jsulmJ raven-worxR 2 Replies Last reply
    0
    • Lucas_1603L Lucas_1603

      @jsulm I would like to describe more details for you to understand my problems clearly


      This is exactly what I have tried :

      After downloading taglib (version 1.11.1) from taglib.org, I built it with cmake and got a .dll and a .dll.a file. Then I brought taglib folder to where my Qt project folder is in and named it 'myTaglib' as this picture

      0_1568179046840_d68d612f-8fa6-4b6b-a3cd-6f08b865a89c-image.png

      When I go to 'myTaglib' folder, I'll get these items

      0_1568179174653_477fd0c0-2ce1-449c-9514-859557de7c2f-image.png
      Now jumping into .pro file, I tried to link to taglib:

      QT += quick multimedia core
      CONFIG += c++11
      INCLUDEPATH += $$PWD/myTaglib
      DEPENDPATH += $$PWD/myTaglib
      LIBS += -L$$PWD/myTaglib -ltag
      

      And in header file, I included necessary files and using namespace TagLib like this:

      #include <tag.h>
      #include <fileref.h>
      #include <mpeg/id3v2/id3v2tag.h>
      #include <mpeg/mpegfile.h>
      #include <mpeg/id3v2/id3v2frame.h>
      #include <mpeg/id3v2/id3v2header.h>
      #include <mpeg/id3v2/frames/attachedpictureframe.h>
      using namespace TagLib;
      

      After all, I built my project and got some errors:

      ...
      undefined reference to `__imp__ZN6TagLib8FileNameC1EPKc' in player.cpp - line 94
      undefined reference to `__imp__ZN6TagLib7FileRefC1ENS_8FileNameEbNS_15AudioProperties9ReadStyleE' in player.cpp - line 94
      undefined reference to `__imp__ZNK6TagLib7FileRef3tagEv' in player.cpp - line 95
      undefined reference to `__imp__ZNK6TagLib6String10toCWStringEv' in player.cpp - line 97
      undefined reference to `__imp__ZNK6TagLib6String10toCWStringEv' in player.cpp - line 96
      ...
      

      Then, I checked these lines but it didn't show something like underlined error or red text or something like that, you can see this picture

      0_1568179229760_05b4470b-fb3c-4c9c-a996-73498a0a3e5a-image.png

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #12

      @lucas_1603 Can you show the linker call? Either it can't find the lib or the lib is not compatible.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Lucas_1603L 1 Reply Last reply
      0
      • jsulmJ jsulm

        @lucas_1603 Can you show the linker call? Either it can't find the lib or the lib is not compatible.

        Lucas_1603L Offline
        Lucas_1603L Offline
        Lucas_1603
        wrote on last edited by
        #13

        @jsulm You mean this one (sorry if I misunderstood what you mean):
        0_1568179729372_09905dc4-15dd-42d4-84dc-cd8cbfbe052a-image.png

        jsulmJ 1 Reply Last reply
        0
        • Lucas_1603L Lucas_1603

          @jsulm You mean this one (sorry if I misunderstood what you mean):
          0_1568179729372_09905dc4-15dd-42d4-84dc-cd8cbfbe052a-image.png

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #14

          @lucas_1603 Yes, your taglib is not compatible with the compiler you're using.
          Do you really use exact same compiler you used to compile taglib?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          Lucas_1603L 1 Reply Last reply
          0
          • jsulmJ jsulm

            @lucas_1603 Yes, your taglib is not compatible with the compiler you're using.
            Do you really use exact same compiler you used to compile taglib?

            Lucas_1603L Offline
            Lucas_1603L Offline
            Lucas_1603
            wrote on last edited by
            #15

            @jsulm I built taglib with MinGW and in this project I think it also built with MinGW
            0_1568180758700_d5cd9775-3482-46ed-94bf-f581462d40af-image.png

            jsulmJ 1 Reply Last reply
            0
            • Lucas_1603L Lucas_1603

              @jsulm I built taglib with MinGW and in this project I think it also built with MinGW
              0_1568180758700_d5cd9775-3482-46ed-94bf-f581462d40af-image.png

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #16

              @lucas_1603 I'm not a Windows expert, but I think you really need .lib file on Windows at build time, not .dll

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              Lucas_1603L 1 Reply Last reply
              0
              • jsulmJ jsulm

                @lucas_1603 I'm not a Windows expert, but I think you really need .lib file on Windows at build time, not .dll

                Lucas_1603L Offline
                Lucas_1603L Offline
                Lucas_1603
                wrote on last edited by
                #17

                @jsulm Yes, I'll try to find it out. Anw, thank you so much for your time, you helped me a lot

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #18

                  Hi,

                  One other thing that you can try is to link directly to the static .a library. Use the full path to that file using $$PWD.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  Lucas_1603L 1 Reply Last reply
                  1
                  • Lucas_1603L Lucas_1603

                    @jsulm I would like to describe more details for you to understand my problems clearly


                    This is exactly what I have tried :

                    After downloading taglib (version 1.11.1) from taglib.org, I built it with cmake and got a .dll and a .dll.a file. Then I brought taglib folder to where my Qt project folder is in and named it 'myTaglib' as this picture

                    0_1568179046840_d68d612f-8fa6-4b6b-a3cd-6f08b865a89c-image.png

                    When I go to 'myTaglib' folder, I'll get these items

                    0_1568179174653_477fd0c0-2ce1-449c-9514-859557de7c2f-image.png
                    Now jumping into .pro file, I tried to link to taglib:

                    QT += quick multimedia core
                    CONFIG += c++11
                    INCLUDEPATH += $$PWD/myTaglib
                    DEPENDPATH += $$PWD/myTaglib
                    LIBS += -L$$PWD/myTaglib -ltag
                    

                    And in header file, I included necessary files and using namespace TagLib like this:

                    #include <tag.h>
                    #include <fileref.h>
                    #include <mpeg/id3v2/id3v2tag.h>
                    #include <mpeg/mpegfile.h>
                    #include <mpeg/id3v2/id3v2frame.h>
                    #include <mpeg/id3v2/id3v2header.h>
                    #include <mpeg/id3v2/frames/attachedpictureframe.h>
                    using namespace TagLib;
                    

                    After all, I built my project and got some errors:

                    ...
                    undefined reference to `__imp__ZN6TagLib8FileNameC1EPKc' in player.cpp - line 94
                    undefined reference to `__imp__ZN6TagLib7FileRefC1ENS_8FileNameEbNS_15AudioProperties9ReadStyleE' in player.cpp - line 94
                    undefined reference to `__imp__ZNK6TagLib7FileRef3tagEv' in player.cpp - line 95
                    undefined reference to `__imp__ZNK6TagLib6String10toCWStringEv' in player.cpp - line 97
                    undefined reference to `__imp__ZNK6TagLib6String10toCWStringEv' in player.cpp - line 96
                    ...
                    

                    Then, I checked these lines but it didn't show something like underlined error or red text or something like that, you can see this picture

                    0_1568179229760_05b4470b-fb3c-4c9c-a996-73498a0a3e5a-image.png

                    raven-worxR Offline
                    raven-worxR Offline
                    raven-worx
                    Moderators
                    wrote on last edited by raven-worx
                    #19

                    @lucas_1603
                    rename taglib.dll.a to taglib.a

                    Also read this

                    --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                    If you have a question please use the forum so others can benefit from the solution in the future

                    Lucas_1603L 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Hi,

                      One other thing that you can try is to link directly to the static .a library. Use the full path to that file using $$PWD.

                      Lucas_1603L Offline
                      Lucas_1603L Offline
                      Lucas_1603
                      wrote on last edited by
                      #20

                      @sgaist I tried this:

                      LIBS += -L$$PWD/myTaglib -llibtag.dll.a
                      

                      But the linker said "cannot find -llibtag.dll.a"

                      0_1568186282504_b509288b-18da-4b10-95eb-9f07c6a52c8c-image.png

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #21

                        As already suggested, try with LIBS += -l$$PWD/myTagLib/libtag.dll.a

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • raven-worxR raven-worx

                          @lucas_1603
                          rename taglib.dll.a to taglib.a

                          Also read this

                          Lucas_1603L Offline
                          Lucas_1603L Offline
                          Lucas_1603
                          wrote on last edited by
                          #22

                          @raven-worx
                          After rename, I got these:
                          0_1568186557563_5f77e916-dfc5-4c2e-9222-bcb6ff540f70-image.png

                          And in .pro file, I wrote:

                          INCLUDEPATH += $$PWD/myTaglib
                          DEPENDPATH += $$PWD/myTaglib
                          LIBS += -L$$PWD/myTaglib -ltag
                          

                          But I still got some errors:
                          0_1568186656286_ecd0b346-0693-4b1d-bdf9-d679133936da-image.png

                          raven-worxR jsulmJ 2 Replies Last reply
                          0
                          • Lucas_1603L Lucas_1603

                            @raven-worx
                            After rename, I got these:
                            0_1568186557563_5f77e916-dfc5-4c2e-9222-bcb6ff540f70-image.png

                            And in .pro file, I wrote:

                            INCLUDEPATH += $$PWD/myTaglib
                            DEPENDPATH += $$PWD/myTaglib
                            LIBS += -L$$PWD/myTaglib -ltag
                            

                            But I still got some errors:
                            0_1568186656286_ecd0b346-0693-4b1d-bdf9-d679133936da-image.png

                            raven-worxR Offline
                            raven-worxR Offline
                            raven-worx
                            Moderators
                            wrote on last edited by
                            #23

                            @lucas_1603 said in Taglib Library:

                            But I still got some errors:

                            your problem is not that it can't find the lib but that it finds it already and says it is incompatible.
                            So you need to change the compiler in either of your 2 compilations.

                            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                            If you have a question please use the forum so others can benefit from the solution in the future

                            Lucas_1603L 1 Reply Last reply
                            0
                            • Lucas_1603L Offline
                              Lucas_1603L Offline
                              Lucas_1603
                              wrote on last edited by
                              #24

                              @sgaist
                              I tried it out but it still didn't work, here is what I got:
                              0_1568187535214_c1acc79f-fa58-44bd-b417-c4a18fa39530-image.png
                              I don't know why libtag.dll.a was in the same folder as my project (Drive E) but it said "cannot find..."

                              1 Reply Last reply
                              0
                              • raven-worxR raven-worx

                                @lucas_1603 said in Taglib Library:

                                But I still got some errors:

                                your problem is not that it can't find the lib but that it finds it already and says it is incompatible.
                                So you need to change the compiler in either of your 2 compilations.

                                Lucas_1603L Offline
                                Lucas_1603L Offline
                                Lucas_1603
                                wrote on last edited by
                                #25

                                @raven-worx
                                I built taglib with MinGW and I also did that for my project.
                                I built taglib by this code block (followed by this tutorial):

                                cd $TAGLIB
                                mkdir build
                                cd build
                                cmake -G "MinGW Makefiles" -D CMAKE_CXX_COMPILER=g++.exe -D CMAKE_MAKE_PROGRAM=mingw32-make.exe -DBUILD_SHARED_LIBS=ON -DENABLE_STATIC_RUNTIME=OFF ..
                                

                                And here is the compiler of my project:

                                0_1568188775836_119ffd66-6a39-49df-8bb2-53939d217323-image.png

                                1 Reply Last reply
                                0
                                • Lucas_1603L Lucas_1603

                                  @raven-worx
                                  After rename, I got these:
                                  0_1568186557563_5f77e916-dfc5-4c2e-9222-bcb6ff540f70-image.png

                                  And in .pro file, I wrote:

                                  INCLUDEPATH += $$PWD/myTaglib
                                  DEPENDPATH += $$PWD/myTaglib
                                  LIBS += -L$$PWD/myTaglib -ltag
                                  

                                  But I still got some errors:
                                  0_1568186656286_ecd0b346-0693-4b1d-bdf9-d679133936da-image.png

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #26

                                  @lucas_1603 Come on, your lib is called libtag.a not libtag.dll.a, so please change it to

                                  LIBS += -l$$PWD/myTagLib/libtag.a
                                  

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  Lucas_1603L 1 Reply Last reply
                                  0
                                  • jsulmJ jsulm

                                    @lucas_1603 Come on, your lib is called libtag.a not libtag.dll.a, so please change it to

                                    LIBS += -l$$PWD/myTagLib/libtag.a
                                    
                                    Lucas_1603L Offline
                                    Lucas_1603L Offline
                                    Lucas_1603
                                    wrote on last edited by
                                    #27

                                    @jsulm
                                    As @raven-worx suggested, I renamed libtag.dll.a to libtag.a and then I tried with LIBS += -l$$PWD/myTaglib/libtag.a as you said but it still didn't work, here is what I got:

                                    0_1568203223374_7985d4a4-3288-4158-b81c-f3e469677810-image.png
                                    Even though I had libtag.a in my myTaglib folder but the linker said "cannot find..."

                                    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