On 08/09/2005 at 7:53 Andreas Fester wrote: > >This looks like the log4cxx.lib link library is not linked with your >project. Are you sure that you added it to the libraries of your project? >Otherwise, please post a minimal source code example, like >
Hi Thanks for your reply. I'm trying to compile the following code: ------------- // include log4cxx header files. #include <log4cxx/logger.h> #include <log4cxx/basicconfigurator.h> #include <log4cxx/propertyconfigurator.h> #include <log4cxx/helpers/exception.h> using namespace log4cxx; using namespace log4cxx::helpers; // Define a static logger variable so that it references the // Logger instance named "MyApp". LoggerPtr logger(Logger::getLogger("MyApp")); int main(int argc, char **argv) { int result = EXIT_SUCCESS; try { if (argc > 1) { // BasicConfigurator replaced with PropertyConfigurator. PropertyConfigurator::configure(argv[1]); } else { BasicConfigurator::configure(); } LOG4CXX_INFO(logger, "Entering application."); LOG4CXX_INFO(logger, "Exiting application."); } catch(Exception&) { result = EXIT_FAILURE; } return result; } ---------------- I've copied log4cxx "include" folder to my project folder and passed this path as parameter to compiler with /I. Then I copied log4cxx.lib to my project folder and added to linker options. Nevertheless I get the message: Linking... MyPrueba.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall log4cxx::Logger::forcedLog(class log4cxx::helpers::ObjectPtrT<class log4cxx::Level> const &,class std::basic_string<char,struct std::char_traits< char>,class std::allocator<char> > const &,char const *,int)" ([EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED]@log4cxx@@@helpe [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@[EMAIL PROTECTED]@2@@std@@[EMAIL PROTECTED]) MyPrueba.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl log4cxx::PropertyConfigurator::configure(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (_ [EMAIL PROTECTED]@log4cxx@@[EMAIL PROTECTED] [EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@2@@std@@@Z) Debug/plog.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. plog.exe - 3 error(s), 0 warning(s) Thanks in advance for any clue to solve this. J PD: I'm using VC++ 6 in WinXP.