0

I have another problem ... I downloaded the log4cpp library and compiled it via Microsoft Visual Studio into a .lib-file. Now I want to link that library into a QT Project, but whenever I call a function, such as

std::string initFileName = "log.properties";
log4cpp::PropertyConfigurator::configure(initFileName);

I get lots of errors saying

"undefined reference to `log4cpp::PropertyConfigurator::configure(std::string const&)'"

Here's the code in the project file:

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

I don't know, what to do :(

Werner Henze
  • 16,404
  • 12
  • 44
  • 69
TheWieand
  • 253
  • 3
  • 18

1 Answers1

0

If the library is compiled with Visual Studio, you should configure the project to use that same compiler instead of mingw/gcc.

alexisdm
  • 29,448
  • 6
  • 64
  • 99