Taglib In Qt

  • Hi. I need help. I'm working on a musicplayer and I wanted to use Taglib in my app so I downloaded taglib-1.10 but I have no idea what to do with it or add which file to my app. Should I make the folder with cmake and then add some files in it to my app?
    What should I do?
    Any help would be appreciated

  • Qt Champions 2017

    well if u already have the actual library,
    then often the step involved to use it ,
    is to explain compiler there to get the library and then also some
    .h file to know what functions is available.
    so to know how to use the .a file
    so normally
    it is adding
    LIBS += -L[path to lib] -l[name of lib]
    to the .pro file.

    If you do not have the actual library yet, you might need to build it.

    Are you on windows or linux`?

  • I'm on linux fedora. I downloaded the file in
    Do I need to build it with cmake?
    And I will only need to add the .a file to my app?

  • Qt Champions 2017

    Ok super.
    Yes, I think you need to build it. seems to be only source.
    It should build the .a file.

    You then open your .pro file, right click ( just in middle of file)
    and choose "Add library"
    Then browse to the .a file.

    You then also need some .h file added to the project from the tablib folder.

  • I built the folder with cmake but there is no .a file.
    I built it this way in terminal

    cd /toTheTaglibFolder
    cmake taglib-1.10(the folder)

    What am I doing wrong?
    And which .h files I need to add to my project?

    And also thank you for answering :)

  • Qt Champions 2017

    hi what happened what u typed
    cmake taglib-1.10(the folder)

    else try
    cd taglib-1.1

  • Hi. I did what you said but look what happened:

    [shahriar@localhost ~]$ cd Desktop/
    [shahriar@localhost Desktop]$ cd taglib-1.10/
    [shahriar@localhost taglib-1.10]$ ./configure
    bash: ./configure: No such file or directory
    [shahriar@localhost taglib-1.10]$

    if this is not working is there another way to get and edit tags in my app beside QMediaPlayer.metaData(); (because it truly terrible) or should I only focus on taglib?

  • Lifetime Qt Champion


    If you are running on Linux, your distribution is likely to provide that library. Check that with the package manager and install the developer package for that library. That should simplify things.

  • Hi
    After trying a while I got a libtag.so file and about 104 header files.
    I want the users to be able to use this app so what are the right headers to add into my project(music player) ?
    and won't the .h files need .cpp files?

  • Qt Champions 2017

    Good work
    That is a shared library
    You can read about using them here
    In short, use "Add library" function as i mention in post before.

    Then look at the .H files. is there a taglib.h ?
    that would be a good guess.

    The cpp are in the SO file so to say.
    So u use the H files to know what the SO offers and the SO provides
    what the H file declares.

  • Hi.
    I finally did it.
    Thank you so much @mrjj & @SGaist. Both of you helped so much

  • Qt Champions 2017

    Congrationations :)
    Good work!

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.