Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to use TagLib into my Qt c++ Project
Punit last edited by
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.
If you mean add that library to your Qt project, you can follow that guide for Qt Creator.
Punit last edited by Punit
@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).
- Download TagLib-1.6.3.
Now using terminal:
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.
Punit last edited by
After searching, I found a solution.
$ cd taglib-1.6.3
$ cmake -DCMAKE_BUILD_TYPE=Release
$ 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>
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
Since your on Linux, why not install the taglib devel package from your distribution ?