2017-02-14 77 views
0

如果我嘗試引用外部TagLib庫在我的代碼(例如TagLib::FileRef f(path);),然後當我建立我的Qt Creator的項目中,我得到以下錯誤,錯誤鏈接標籤庫Qt的

symbol(s) not found for architecture x86_64 
linker command failed with exit code 1 (use -v to see invocation) 

Undefined symbols for architecture x86_64: 
    "_inflate", referenced from: 
     TagLib::zlib::decompress(TagLib::ByteVector const&) in libtag.a(tzlib.cpp.o) 
    "_inflateEnd", referenced from: 
     TagLib::zlib::decompress(TagLib::ByteVector const&) in libtag.a(tzlib.cpp.o) 
    "_inflateInit_", referenced from: 
     TagLib::zlib::decompress(TagLib::ByteVector const&) in libtag.a(tzlib.cpp.o) 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
make: *** [Opus.app/Contents/MacOS/Opus] Error 1 
21:06:29: The process "/usr/bin/make" exited with code 2. 
Error while building/deploying project Opus (kit: Desktop Qt 5.7.0 clang 64bit) 
When executing step "Make" 

我的.pro文件,

QT  += core gui sql 

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 

TARGET = Opus 
TEMPLATE = app 


SOURCES += main.cpp\ 
     mainwindow.cpp \ 
    tabunit.cpp \ 
    tabholder.cpp \ 
    dbmanager.cpp \ 
    articleadditiondialog.cpp \ 
    articlefilemodel.cpp \ 
    directoryiterator.cpp \ 
    articleattributes.cpp 

HEADERS += mainwindow.h \ 
    tabunit.h \ 
    tabholder.h \ 
    dbmanager.h \ 
    articleproperty.h \ 
    articleadditiondialog.h \ 
    articlefilemodel.h \ 
    directoryiterator.h \ 
    articleattributes.h 

FORMS += mainwindow.ui \ 
    articleadditiondialog.ui 

LIBS += -L$$PWD/../../../Libraries/taglib-1.11.1/taglib/ -ltag 

INCLUDEPATH += $$PWD/../../../Libraries/taglib-1.11.1/include 

在/Libraries/taglib-1.11.1/我有this

任何幫助,將不勝感激,謝謝。

回答