How to use Taglib

Festus Hagen festushagenlists at yahoo.com
Wed Sep 14 09:43:45 UTC 2016


Add DEFINES += TAGLIB_STATIC to your Qt project file for static builds.


-Enjoyfh : )_~



________________________________
From: Boakye Dennis <nanakofiboakye at gmail.com>
To: taglib-devel at kde.org 
Sent: Tuesday, September 13, 2016 1:38 PM
Subject: How to use Taglib



Dear Sirs, Madams,
Congratulations to the good work you are doing. However I have problem with incorporating TagLib into my project. I have been able to build Taglib and I have the library files. I followed Qts wizard on how to add 3rd party libraries into Qt and was successful but I can't use it even after adding the necessary files at main. 
For eg. when write this code:

#include <QApplication>
#include <taglib/fileref.h>
#include <taglib/taglib.h>

#include <QDebug>

int main(int arg, char** argc)
{
   TagLib::FileRef*source=newTagLib::FileRef("c:/7Days.mp3"); 

qDebug()<<"SongArtist:"<<source->tag()->artist().to8Bit(true).data();


return 0;
}


I get the following errors:

main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl TagLib::String::~String(void)" (__imp_??1String at TagLib@@UEAA at XZ) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl TagLib::String::to8Bit(bool)const " (__imp_?to8Bit at String@TagLib@@QEBA?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@_N at Z) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl TagLib::FileName::FileName(char const *)" (__imp_??0FileName at TagLib@@QEAA at PEBD@Z) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl TagLib::FileRef::FileRef(class TagLib::FileName,bool,enum TagLib::AudioProperties::ReadStyle)" (__imp_??0FileRef at TagLib@@QEAA at VFileName@1 at _NW4ReadStyle@AudioProperties at 1@@Z) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl TagLib::FileRef::~FileRef(void)" (__imp_??1FileRef at TagLib@@UEAA at XZ) referenced in function "public: virtual void * __cdecl TagLib::FileRef::`scalar deleting destructor'(unsigned int)" (??_GFileRef at TagLib@@UEAAPEAXI at Z)
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: class TagLib::Tag * __cdecl TagLib::FileRef::tag(void)const " (__imp_?tag at FileRef@TagLib@@QEBAPEAVTag at 2@XZ) referenced in function main
release\Mappa.exe:-1: error: LNK1120: 6 unresolved externals


Please what am I missing? Your response would be deeply appreciated. Thank you


More information about the taglib-devel mailing list