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. How to use TagLib into my Qt c++ Project
QtWS25 Last Chance

How to use TagLib into my Qt c++ Project

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt5.6taglibmetadata
5 Posts 2 Posters 5.6k 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.
  • P Offline
    P Offline
    Punit
    wrote on 10 Jun 2016, 13:00 last edited by
    #1

    Hello,

    I'd like to get the additional information of a media file in a qt application i'm building and so i decided to use taglib. Can anyone tell me how to use TagLib in qt from the beginning ? The version I got was 1.6.3.

    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Jun 2016, 21:58 last edited by
      #2

      Hi,

      If you mean add that library to your Qt project, you can follow that guide for Qt Creator.

      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
      • P Offline
        P Offline
        Punit
        wrote on 14 Jun 2016, 06:53 last edited by Punit
        #3

        @Moderators @mrjj @Qt-Champions-2015 @Lifetime-Qt-Champion
        I have no idea what to do with it or add which file to my app. can you please explain how to build it?
        What I did so far:
        (Currently working on mac but want it for both Windows and mac).

        1. Download TagLib-1.6.3.

        Now using terminal:
        cd /Taglib-1.6.3
        ./configure
        make
        sudo make install

        A default build and install. So, the configure prefix was /usr/local. But there is no .a file in my lib folder. Please guide me with necessary steps to build and use Taglib in my qt Project.

        Here is the Snapshot: http://postimg.org/image/qftzg7vdt/
        Thanks @SGaist

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Punit
          wrote on 14 Jun 2016, 09:51 last edited by
          #4

          After searching, I found a solution.

          $ cd taglib-1.6.3

          $ cmake -DCMAKE_BUILD_TYPE=Release
          -DCMAKE_OSX_DEPLOYMENT_TARGET=10.6
          -DCMAKE_OSX_ARCHITECTURES="i386;x86_64"
          -DENABLE_STATIC=ON
          -DCMAKE_INSTALL_PREFIX="/Users/macwaves/Desktop/lib2"

          $ make

          $ sudo make install

          Now I have "libtag.a" inside my lib folder (/Users/macwaves/Desktop/lib2/lib) and about 75 header files inside "/Users/macwaves/Desktop/lib2/include/taglib".

          I have created a project and then open .pro file, right click ( just in middle of file)
          and choose "Add library", then browse to the .a file.

          win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../Users/macwaves/Desktop/lib2/lib/release/ -ltag
          else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../Users/macwaves/Desktop/lib2/lib/debug/ -ltag
          else:unix: LIBS += -L$$PWD/../../../../Users/macwaves/Desktop/lib2/lib/ -ltag
          
          INCLUDEPATH += $$PWD/../../../../Users/macwaves/Desktop/lib2/include/taglib
          DEPENDPATH += $$PWD/../../../../Users/macwaves/Desktop/lib2/include/taglib
          
          win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../Users/macwaves/Desktop/lib2/lib/release/libtag.a
          else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../Users/macwaves/Desktop/lib2/lib/debug/libtag.a
          else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../Users/macwaves/Desktop/lib2/lib/release/tag.lib
          else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../Users/macwaves/Desktop/lib2/lib/debug/tag.lib
          else:unix: PRE_TARGETDEPS += $$PWD/../../../../Users/macwaves/Desktop/lib2/lib/libtag.a
          

          Now In my mainwindow.h

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

          and mainwindow.cpp

          TagLib::FileRef f("/Users/macwaves/Desktop/Testing/my.mp3",true);
          

          but it's generating errors.
          :-1: error: symbol(s) not found for architecture x86_64
          :-2: error: linker command failed with exit code 1 (use -v to see invocation)

          Please help me ! Thanks

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 14 Jun 2016, 19:59 last edited by
            #5

            Since your on Linux, why not install the taglib devel package from your distribution ?

            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
            1

            5/5

            14 Jun 2016, 19:59

            • Login

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