Log4cxx
  1. Log4cxx
  2. LOGCXX-302

Initializing Error c0150002 when loading an application, linking to Log4CXX

    Details

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

      Description

      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")));
      BasicConfigurator::configure();
      LOG4CXX_DEBUG(logger, _T("BasicConfigurator loaded."));

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

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

      catch(Exception&)

      { 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.vcproj
        131 kB
        Michael Steinecke
      2. log4cxx.sln
        10 kB
        Michael Steinecke
      3. log4cxx.dll.intermediate.manifest
        0.4 kB
        Michael Steinecke
      4. log4cxx.dll
        1.66 MB
        Michael Steinecke

        Activity

        Hide
        Feng Nan added a comment -

        Did you compile log4cxx with ANT or msdev .sln file?

        I tried ANT and encountered a lot of issues.

        Show
        Feng Nan added a comment - Did you compile log4cxx with ANT or msdev .sln file? I tried ANT and encountered a lot of issues.
        Hide
        Michael Steinecke added a comment -

        The build is done without ANT. You can find the VS build script in the .vcproj file.

        Show
        Michael Steinecke added a comment - The build is done without ANT. You can find the VS build script in the .vcproj file.
        Hide
        Joseph Southwell added a comment -

        That error means that the application manifest is referencing VC runtimes that don't exist on the target machine. If you load your .EXE or .DLL into Visual Studio's resource editor you can hand edit the version string for the name="Microsoft.VC90.CRT". Either your application or one of its DLLs is referencing a vc runtime dll that is not on that system. This is not a log4cxx problem so you will have to look elsewhere for help.

        Show
        Joseph Southwell added a comment - That error means that the application manifest is referencing VC runtimes that don't exist on the target machine. If you load your .EXE or .DLL into Visual Studio's resource editor you can hand edit the version string for the name="Microsoft.VC90.CRT". Either your application or one of its DLLs is referencing a vc runtime dll that is not on that system. This is not a log4cxx problem so you will have to look elsewhere for help.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development