我准备TagLib用于我的TagLib项目,如下所示:
构建Makefile:
构建项目: MinGW的: C:\ GitRoot \标签库>使用gmake
安装项目: MinGW的: C:\ GitRoot \标签库> gmake安装
我将上面生成的文件复制到Qt上的Taglib项目中,现在这是我的 taglibtest项目文件夹结构:
然后将以下文件添加到我的项目中:
F:* \ taglibtest \标签库\ lib中\ libtag.dll.a **
F:* \ taglibtest \ taglib \ lib \ libtag_c.dll.a **
如下所示 tablibtest.pro
taglibtest.pro
QT += core
QT -= gui
CONFIG += c++11
TARGET = taglibtest
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/taglib/lib/ -llibtag.dll
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/taglib/lib/ -llibtag.dlld
INCLUDEPATH += $$PWD/taglib/include
DEPENDPATH += $$PWD/taglib/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/taglib/lib/ -llibtag_c.dll
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/taglib/lib/ -llibtag_c.dlld
INCLUDEPATH += $$PWD/taglib/include
DEPENDPATH += $$PWD/taglib/include
HEADERS += \
taglib/include/taglib/aifffile.h \
taglib/include/taglib/aiffproperties.h \
etc.... \
etc.... \
etc....
主要:
**main.cpp**
#include <QCoreApplication>
#include <QDebug>
#include <taglib/include/taglib/fileref.h>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
TagLib::FileRef f("E:/Dire Straits - Sultans of Swing.mp3");
return a.exec();
}
运行项目时出现以下错误:
:-1: error: cannot find -llibtag.dll
:-1: error: cannot find -llibtag_c.dll
collect2.exe:-1: error: error: ld returned 1 exit status
我的项目中缺少什么?我应该在项目中包含哪些文件才能使用 Taglib框架
提前谢谢大家。