我还有另一个问题。我下载了log4cpp库,并通过Microsoft Visual Studio将其编译为.lib文件。现在我想将该库链接到一个QT项目中,但是每当我调用一个函数时,比如
std::string initFileName = "log.properties";
log4cpp::PropertyConfigurator::configure(initFileName);我收到很多错误,说
"undefined reference to `log4cpp::PropertyConfigurator::configure(std::string const&)'"以下是项目文件中的代码:
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/log4cpp/ -llog4cppLIB
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/log4cpp/ -llog4cppD
else:unix: LIBS += -L$$PWD/log4cpp/ -llog4cppLIB
INCLUDEPATH += $$PWD/log4cpp/include
DEPENDPATH += $$PWD/log4cpp/include我不知道,该怎么办:
发布于 2013-05-15 07:32:44
如果该库是用Visual Studio编译的,那么您应该将项目配置为使用相同的编译器,而不是使用mingw/gcc。
https://stackoverflow.com/questions/16553372
复制相似问题