Uploaded image for project: 'Log4cxx'
  1. Log4cxx
  2. LOGCXX-83

log4cxx::Level::ERROR fails to compile when GDI enabled

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP, Visual Studio 2005

      Description

      Use of log4cxx::Level::ERROR fails with compilation error in some C++ source files, although DEBUG and INFO compile correctly.

      error C2589 'constant' : illegal token on right side of '::'

      I have tracked it down to the <wingdi.h> header file and managed to avoid the error by using the NOGDI definition. This is okay in my situation, but may cause others problems?

      // fails
      #undef NOGDI
      #include <windows.h>
      ...
      log4cxx::logstream* ls = new log4cxx::logstream(logger, log4cxx::Level::ERROR);

      // works
      #define NOGDI
      #include <windows.h>
      ...
      log4cxx::logstream* ls = new log4cxx::logstream(logger, log4cxx::Level::ERROR);

      Chris

        Attachments

          Activity

            People

            • Assignee:
              carnold@apache.org Curt Arnold
              Reporter:
              obe1line Chris Storah
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: