How to use Taglib

Boakye Dennis nanakofiboakye at gmail.com
Tue Sep 13 17:38:01 UTC 2016


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 = new TagLib::FileRef("c:/7 Days.mp3");


    qDebug()<< "Song Artist: " << 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20160913/8a541484/attachment.html>


More information about the taglib-devel mailing list