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
Qt 6.11 is out! See what's new in the release blog

Taglib Library

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
27 Posts 4 Posters 11.5k Views 2 Watching
  • 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.
  • Lucas_1603L Offline
    Lucas_1603L Offline
    Lucas_1603
    wrote on last edited by Lucas_1603
    #1

    Hi all,
    I try to link taglib to my project but when I build it, I got errors as this photo 0_1567934164110_70449259_370656957209607_8897869552256286720_n.png

    This is my .pro file:
    0_1567934664533_a60d29c3-ff6a-4e7e-9693-382f10f299e1-image.png

    In header files, I included all necessary files like this
    0_1567934724344_230d65b6-d9fc-4b00-be5d-e13cc456d4eb-image.png
    I don't know what problems I'm facing with :'(
    Hope you guys help me deal with it. Thank you so much

    raven-worxR 1 Reply Last reply
    0
    • Lucas_1603L Lucas_1603

      Hi all,
      I try to link taglib to my project but when I build it, I got errors as this photo 0_1567934164110_70449259_370656957209607_8897869552256286720_n.png

      This is my .pro file:
      0_1567934664533_a60d29c3-ff6a-4e7e-9693-382f10f299e1-image.png

      In header files, I included all necessary files like this
      0_1567934724344_230d65b6-d9fc-4b00-be5d-e13cc456d4eb-image.png
      I don't know what problems I'm facing with :'(
      Hope you guys help me deal with it. Thank you so much

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

      @lucas_1603
      what compiler are you using?
      anyway you never link against DLL file. And there should also be a corresponding warning in the build console
      LIBS += -L$$PWD/taglib -ltag or LIBS += -L$$PWD/taglib -llibtag (depnding how the lib file is called)
      taglib should also provide a .lib/.a file?

      --- 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
      1
      • raven-worxR raven-worx

        @lucas_1603
        what compiler are you using?
        anyway you never link against DLL file. And there should also be a corresponding warning in the build console
        LIBS += -L$$PWD/taglib -ltag or LIBS += -L$$PWD/taglib -llibtag (depnding how the lib file is called)
        taglib should also provide a .lib/.a file?

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

        @raven-worx
        I'm using MinGW compiler. Taglib provides a .dll and a .a file

        jsulmJ 1 Reply Last reply
        0
        • Lucas_1603L Lucas_1603

          @raven-worx
          I'm using MinGW compiler. Taglib provides a .dll and a .a file

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

          @lucas_1603 Did you build the lib by yourself?
          If you downloaded it: from where and which compiler was used to build it?

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

          Lucas_1603L 1 Reply Last reply
          0
          • jsulmJ jsulm

            @lucas_1603 Did you build the lib by yourself?
            If you downloaded it: from where and which compiler was used to build it?

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

            @jsulm I downloaded taglib from taglib.org and used cmake to build it. After successfully built, I got a .dll and a .dll.a file. What I have to do next to link taglib to my project? I'm new in Qt so guide me step-by-step, please.
            Thanks a lot

            jsulmJ 1 Reply Last reply
            0
            • Lucas_1603L Lucas_1603

              @jsulm I downloaded taglib from taglib.org and used cmake to build it. After successfully built, I got a .dll and a .dll.a file. What I have to do next to link taglib to my project? I'm new in Qt so guide me step-by-step, please.
              Thanks a lot

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

              @lucas_1603 There should be a .lib file as well as @raven-worx said.
              Also, the way you use LIBS in pro file is wrong: remove .dll from file name (again, like @raven-worx suggested). When adding libs using -l the "lib" prefix and file extension (.lib, .so, ...) must be removed. Example: if lib is called libfoo.lib you add "-lfoo" to your pro file.

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

              Lucas_1603L 1 Reply Last reply
              0
              • jsulmJ jsulm

                @lucas_1603 There should be a .lib file as well as @raven-worx said.
                Also, the way you use LIBS in pro file is wrong: remove .dll from file name (again, like @raven-worx suggested). When adding libs using -l the "lib" prefix and file extension (.lib, .so, ...) must be removed. Example: if lib is called libfoo.lib you add "-lfoo" to your pro file.

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

                @jsulm I actually cannot find any .lib files. I built taglib following the guidelines of this tutorial. After building process completed, it just generated 2 files more, one is .dll and the other is .dll.a as I said before. I don't know whether I built taglib right or wrong, or there were something I don't well aware of :((

                jsulmJ 1 Reply Last reply
                0
                • Lucas_1603L Lucas_1603

                  @jsulm I actually cannot find any .lib files. I built taglib following the guidelines of this tutorial. After building process completed, it just generated 2 files more, one is .dll and the other is .dll.a as I said before. I don't know whether I built taglib right or wrong, or there were something I don't well aware of :((

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

                  @lucas_1603 Then fix LIBS in your pro file as described before and try again.

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

                  Lucas_1603L 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @lucas_1603 Then fix LIBS in your pro file as described before and try again.

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

                    @jsulm I tried to fix it to LIBS += -L$$PWD/taglib -ltag as you suggested but it raised "cannot find -ltag" error!

                    jsulmJ 1 Reply Last reply
                    0
                    • Lucas_1603L Lucas_1603

                      @jsulm I tried to fix it to LIBS += -L$$PWD/taglib -ltag as you suggested but it raised "cannot find -ltag" error!

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

                      @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.

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

                      Lucas_1603L 1 Reply Last reply
                      0
                      • 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

                                          • Login

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