You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "rm5248 (via GitHub)" <gi...@apache.org> on 2025/11/22 15:14:48 UTC

[I] compile failure with AsyncBuffer [logging-log4cxx]

rm5248 opened a new issue, #563:
URL: https://github.com/apache/logging-log4cxx/issues/563

   It's not immediatetly obvious to me as to why this is broken, but g++ 12.2 on Debian doesn't compile cleanly:
   
   ```
   robert@debian:~/logging-log4cxx/build$ cmake ..
   -- The CXX compiler identification is GNU 12.2.0
   -- Detecting CXX compiler ABI info
   -- Detecting CXX compiler ABI info - done
   -- Check for working CXX compiler: /usr/bin/c++ - skipped
   -- Detecting CXX compile features
   -- Detecting CXX compile features - done
   -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 
   -- Checking for module 'apr-1'
   --   Found apr-1, version 1.7.2
   -- Found APR: /usr/lib/x86_64-linux-gnu/libapr-1.so  
   -- Checking for module 'apr-util-1'
   --   Found apr-util-1, version 1.6.3
   -- Found APR-Util: /usr/lib/x86_64-linux-gnu/libaprutil-1.so;/usr/lib/x86_64-linux-gnu/libldap.so;/usr/lib/x86_64-linux-gnu/liblber.so  
   -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
   -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
   -- Found Threads: TRUE  
   -- Looking for C++ include locale
   -- Looking for C++ include locale - found
   -- Looking for mbsrtowcs
   -- Looking for mbsrtowcs - found
   -- Looking for wcstombs
   -- Looking for wcstombs - found
   -- Looking for fwide
   -- Looking for fwide - found
   -- Looking for syslog
   -- Looking for syslog - found
   -- Looking for pthread_sigmask
   -- Looking for pthread_sigmask - found
   -- Looking for pthread_self
   -- Looking for pthread_self - found
   -- 
   -- 
   -- Log4cxx configuration summary:
   -- 
   --   C++ compiler .................... : /usr/bin/c++
   --   C++ features requested: ......... : 20
   --   Build shared library ............ : ON
   --   Build tests ..................... : ON
   --   Build examples................... : ON
   --   Build fuzzers.................... : OFF
   --   Build site ...................... : OFF
   --   Install prefix .................. : /usr/local
   --   log4cxx library name ............ : log4cxx
   --   log4cxx namespace ............... : log4cxx
   --   log4cxx char API ................ : ON
   --   log4cxx wchar API ............... : ON
   --   log4cxx unichar API ............. : OFF
   --   log4cxx char type ............... : utf-8
   --   character encoding .............. : utf-8
   --   Networking support .............. : ON
   --   DOMConfigurator support ......... : ON
   --   Qt support ...................... : OFF
   --   LOG4CXX_XXXX_ASYNC macros ....... : ON
   --   LOG4CXX_XXXX_FMT_ASYNC macros ... : OFF
   -- C++ version and Boost settings:
   --   Prefer boost: ................... : OFF
   --   make_unique implementation :..... : std::make_unique
   --   filesystem implementation ....... : std::filesystem
   --   format implementation ........... : fmt::format
   --   thread_local support? ........... : TRUE
   -- Applications required for tests:
   --   zip ............................. : /usr/bin/zip
   --   sed ............................. : /usr/bin/sed
   --   gzip ............................ : /usr/bin/gzip
   -- Available appenders:
   --   Async Appender .................. : ON
   --   ODBC Appender ................... : OFF
   --   DB Appender ..................... : ON
   --   SMTP Appender ................... : OFF
   --   XMLSocketAppender ............... : ON
   --   SyslogAppender .................. : ON
   --   Using syslog.h .................. : ON
   --   TelnetAppender .................. : ON
   --   ConsoleAppender ................. : ON
   --   FileAppender .................... : ON
   --   RollingFileAppender ............. : ON
   --   MultiprocessRollingFileAppender . : OFF
   -- Available layouts:
   --   HTMLLayout ...................... : ON
   --   JSONLayout ...................... : ON
   --   PatternLayout ................... : ON
   --   SimpleLayout .................... : ON
   --   XMLLayout ....................... : ON
   --   FMTLayout ....................... : OFF
   -- Configuring done
   -- Generating done
   -- Build files have been written to: /home/robert/logging-log4cxx/build
   robert@debian:~/logging-log4cxx/build$ make
   [  1%] Building CXX object src/main/include/CMakeFiles/log4cxx-include.dir/empty-lib-stub.cpp.o
   [  1%] Linking CXX static library liblog4cxx-include.a
   [  1%] Built target log4cxx-include
   [  1%] Building CXX object src/main/cpp/CMakeFiles/log4cxx.dir/action.cpp.o
   [  1%] Building CXX object src/main/cpp/CMakeFiles/log4cxx.dir/andfilter.cpp.o
   In file included from /home/robert/logging-log4cxx/src/main/include/log4cxx/logger.h:26,
                    from /home/robert/logging-log4cxx/src/main/include/log4cxx/spi/loggingevent.h:23,
                    from /home/robert/logging-log4cxx/src/main/include/log4cxx/spi/filter.h:23,
                    from /home/robert/logging-log4cxx/src/main/include/log4cxx/filter/andfilter.h:21,
                    from /home/robert/logging-log4cxx/src/main/cpp/andfilter.cpp:18:
   /home/robert/logging-log4cxx/src/main/include/log4cxx/helpers/asyncbuffer.h: In member function ‘log4cxx::helpers::AsyncBuffer& log4cxx::helpers::AsyncBuffer::operator<<(const T&)’:
   /home/robert/logging-log4cxx/src/main/include/log4cxx/helpers/asyncbuffer.h:87:39: error: static assertion failed: operator<<(std::ostream&) overload must be provided
      87 |                         static_assert(false, "operator<<(std::ostream&) overload must be provided");
         |                                       ^~~~~
   /home/robert/logging-log4cxx/src/main/include/log4cxx/helpers/asyncbuffer.h: In member function ‘log4cxx::helpers::AsyncBuffer& log4cxx::helpers::AsyncBuffer::operator<<(const T&&)’:
   /home/robert/logging-log4cxx/src/main/include/log4cxx/helpers/asyncbuffer.h:142:39: error: static assertion failed: operator<<(std::ostream&) overload must be provided
     142 |                         static_assert(false, "operator<<(std::ostream&) overload must be provided");
         |                                       ^~~~~
   make[2]: *** [src/main/cpp/CMakeFiles/log4cxx.dir/build.make:90: src/main/cpp/CMakeFiles/log4cxx.dir/andfilter.cpp.o] Error 1
   make[1]: *** [CMakeFiles/Makefile2:1352: src/main/cpp/CMakeFiles/log4cxx.dir/all] Error 2
   make: *** [Makefile:146: all] Error 2
   ```
   
   I can get around the problem by setting the C++ standard to 17


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] compile failure with AsyncBuffer [logging-log4cxx]

Posted by "swebb2066 (via GitHub)" <gi...@apache.org>.
swebb2066 commented on issue #563:
URL: https://github.com/apache/logging-log4cxx/issues/563#issuecomment-3568584734

   Yes, good idea - I think that would save us (and users) some trouble


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] compile failure with AsyncBuffer [logging-log4cxx]

Posted by "swebb2066 (via GitHub)" <gi...@apache.org>.
swebb2066 commented on issue #563:
URL: https://github.com/apache/logging-log4cxx/issues/563#issuecomment-3567560685

   Could you try it with GCC 12.5 which is the most recent GCC 12?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] compile failure with AsyncBuffer [logging-log4cxx]

Posted by "s9w (via GitHub)" <gi...@apache.org>.
s9w commented on issue #563:
URL: https://github.com/apache/logging-log4cxx/issues/563#issuecomment-3883704418

   This happens to us as well with a visual studio 17.14.25 (visual studio 2022, Windows)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] compile failure with AsyncBuffer [logging-log4cxx]

Posted by "rm5248 (via GitHub)" <gi...@apache.org>.
rm5248 commented on issue #563:
URL: https://github.com/apache/logging-log4cxx/issues/563#issuecomment-3568342703

   g++ 12.5.0 also has the issue.  I did a quick search for issues, but I didn't see anything obvious.  Since the ubuntu builds use 13.3, I'm going to guess that this is just a GCC 12 problem and it was fixed in 13.
   
   I think we probably want to do something like:
   ```
   #if defined(__GNUC__) && __GNUC__ <= 12
   #define LOG4CXX_CONCEPT_BROKEN 1
   #else
   #define LOG4CXX_CONCEPT_BROKEN 0
   #endif
   
   ...
   
   #if defined(__cpp_concepts) && 202002 <= __cpp_concepts && !LOG4CXX_CONCEPT_BROKEN
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] compile failure with AsyncBuffer [logging-log4cxx]

Posted by "rm5248 (via GitHub)" <gi...@apache.org>.
rm5248 closed issue #563: compile failure with AsyncBuffer
URL: https://github.com/apache/logging-log4cxx/issues/563


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] compile failure with AsyncBuffer [logging-log4cxx]

Posted by "rm5248 (via GitHub)" <gi...@apache.org>.
rm5248 commented on issue #563:
URL: https://github.com/apache/logging-log4cxx/issues/563#issuecomment-3887653368

   > This happens to us as well with a visual studio 17.14.25 (visual studio 2022, Windows). Log4cxx 1.6.1
   
   could you create a new issue with the error that you're seeing?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] compile failure with AsyncBuffer [logging-log4cxx]

Posted by "rm5248 (via GitHub)" <gi...@apache.org>.
rm5248 commented on issue #563:
URL: https://github.com/apache/logging-log4cxx/issues/563#issuecomment-3567967018

   I can try to compile it later, but I'm more concerned with building out of the box without needing to install a custom compiler.
   
   This is the latest version able to be installed thru the Debian repos:
   ```
   robert@debian:~/logging-log4cxx/build$ g++ --version
   g++ (Debian 12.2.0-14+deb12u1) 12.2.0
   Copyright (C) 2022 Free Software Foundation, Inc.
   This is free software; see the source for copying conditions.  There is NO
   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   ```
   
   Two thoughts:
   
   - this could be related to the `__cpp_concepts` check, there are two versions: `201907L` and `202002L`, we use the second one
   - it could be a GCC bug in the 12.x series.  I have had to do some checks before to see what compiler version is being used and turn on/off certain code.  The `__GNUC__`, `__GNUC_MINOR__`, and `__GNUC_PATCHLEVEL__` macros are useful here


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org