1. Log4cxx
  2. LOGCXX-302

Initializing Error c0150002 when loading an application, linking to Log4CXX


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Invalid
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: Build
    • Labels:
    • Environment:
      Windows XP SP2 x32; Windows Vista Business x32; Visual Studio 2005/2008 Professional;


      I've successfully build an little console application which which staticly links to log4cxx, written in unmanaged C++. When I try to run the application on any PC but my developmentel one, I get this error:
      "The application failed to initialize properly (0xc0150002). Click on Ok to terminate the application."

      Firstly I thought it was due to missing VC redistributals or missing manifest files, but even ensuring the availibity of those, didn't help. Also, the dependancy walker lists no missings for log4cxx or the application.

      Actually I build log4cxx and the App with Visual Studio 2008, professional edition.
      In all cases, the OS is Windows XP SP2 with the latest Hotfixes and patches.

      Things I tryed to resolve the error:
      Using an build from http://littletux.homelinux.org/log4cxx/.
      Building the dll with VS 2005 SP1
      Compiling with /MT instead of /MD and vice versa (for both versions of VS)
      Building the App without linking to log4cxx to detect the problem and as workaround (no errors here - it's a problem due to log4cxx)

      Running the App on another machine with installed VS2005 OR VS2008, the same error occures.

      I hope someone will have an idea or another input for me.

      The developmental PC configuration:
      Win XP SP2
      Versions of Visual Studio: 2008, 2005 SP1, 6 SP6, 1.52

      The code including the library (mostly from the intruduction to Log4CXX):

      // include log4cxx header files.
      #include <log4cxx/logger.h>
      #include <log4cxx/helpers/exception.h>

      using namespace log4cxx;
      using namespace log4cxx::helpers;

      // global staticPointer to an Logger
      static LoggerPtr logger(Logger::getLogger("base"));
      // End log4cxx

      int _tmain(){

      LoggerPtr logger(log4cxx::Logger::getLogger(_T("base.main")));
      LOG4CXX_DEBUG(logger, _T("BasicConfigurator loaded."));

      if (_tcscmp(argv[i-1],_T("/cl"))==0){
      // Load a log4j config file

      { // BasicConfigurator replaced with PropertyConfigurator. PropertyConfigurator::configure(argv[i]); useCL = true; // Flag setzen dass PropertyConfigurator verwendet wird. LOG4CXX_DEBUG(logger, _T("BasicConfigurator with PropertyConfigurator overloaded.")); }


      { LOG4CXX_FATAL(logger, _T("PropertyConfigurator konnte nicht geladen werden!")); return EXIT_FAILURE; }


      // go on with the program - many LOG4CXX_YYYYY Macros are used


      1. log4cxx.dll.intermediate.manifest
        0.4 kB
        Michael Steinecke
      2. log4cxx.vcproj
        131 kB
        Michael Steinecke
      3. log4cxx.sln
        10 kB
        Michael Steinecke
      4. log4cxx.dll
        1.66 MB
        Michael Steinecke


        No work has yet been logged on this issue.


          • Assignee:
            Joseph Southwell
            Michael Steinecke
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: