Reputation: 318
After adding the libmusicxml library to my project in QtCreator (using the VC 2012 Compiler) the project will compile using the release configuration not however using the debug configuration. In the linking phase a number of build problems concering unresolved external symbols occur.
Having read through other posts I realise that I have to link to the library for both configurations separately. I have tried adding the following variants to my .pro-file without any success.
LIBS += -L$$PWD/../Libraries/libmusicxml-3.00-win32/ -llibmusicxml2
INCLUDEPATH += $$PWD/../Libraries/libmusicxml-3.00-win32/include
DEPENDPATH += $$PWD/../Libraries/libmusicxml-3.00-win32/include`
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../Libraries/libmusicxml-3.00-win32/ -llibmusicxml2
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../Libraries/libmusicxml-3.00-win32/ -llibmusicxml2d
INCLUDEPATH += $$PWD/../Libraries/libmusicxml-3.00-win32/include
DEPENDPATH += $$PWD/../Libraries/libmusicxml-3.00-win32/include
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../Libraries/libmusicxml-3.00-win32/ -llibmusicxml2
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../Libraries/libmusicxml-3.00-win32/ -llibmusicxml2
INCLUDEPATH += $$PWD/../Libraries/libmusicxml-3.00-win32/include
DEPENDPATH += $$PWD/../Libraries/libmusicxml-3.00-win32/include
The error messages look like
main.obj:-1: Fehler:LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual _thiscall MusicXML2::xmlreader::~xmlreader(void)" (_imp_??1xmlreader@MusicXML2@@UAE@XZ) referenced in function _main
I hope somebody can help me out, thanks in advance!
Upvotes: 3
Views: 777
Reputation: 12600
In our projects we do it like this:
LIBS += -L$$PWD/../Libraries/libmusicxml-3.00-win32
win32 {
CONFIG(debug, debug|release) {
LIBS += -llibmusicxml2d
} else {
LIBS += -llibmusicxml2
}
}
INCLUDEPATH += $$PWD/../Libraries/libmusicxml-3.00-win32/include
DEPENDPATH += $$PWD/../Libraries/libmusicxml-3.00-win32/include
Upvotes: 2