简体   繁体   中英

Undefined reference using Taglib with Qt

I can't get Taglib to work with Qt on Windows 10 64bits but I can with GNU/Linux 64bits.

在此输入图像描述

I successfuly managed to build Taglib as explain in their manual with cmake and the compiler provided by Qt ( C:\\Qt\\Tools\\mingw730_64\\bin\\ ) and the variable CMAKE_BUILD_TYPE=Release

Then with the shell provided by Qt for MinGW 7.3.0 64bits I can run mingw32-make to build it. With mingw32-make install I have everything I need in C:\\Program Files (x86)\\taglib\\ the .a and .h files (no .dll?).

.pro file generated using the tool to add external libraries in Qt Creator :

LIBS += -L$$PWD/'../../../../../Program Files (x86)/taglib/lib/' -llibtag

INCLUDEPATH += $$PWD/'../../../../../Program Files (x86)/taglib/include'
DEPENDPATH += $$PWD/'../../../../../Program Files (x86)/taglib/include'

cpp code :

void MainWindow::test()
{
    TagLib::FileRef f("Latex Solar Beef.mp3");
}

I was missing the

DEFINES += TAGLIB_STATIC

Problem solved

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM