Nicholas Clark created LOGCXX-526:
-------------------------------------
Summary: GCC-11.1.0 Support
Key: LOGCXX-526
URL: https://issues.apache.org/jira/browse/LOGCXX-526
Project: Log4cxx
Issue Type: Bug
Components: Build
Affects Versions: 0.12.0
Reporter: Nicholas Clark
log4cxx 0.12.0-rc1 does not appear to build successfully with GCC-11.1.0 on
CentOS 7.9.
*CMake:*
{code:java}
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/apache-log4cxx-"${log4cxx_version}"
-DAPR_CONFIG_EXECUTABLE=/opt/apr-1/bin/apr-1-config
-DAPR_UTIL_CONFIG_EXECUTABLE=/opt/apr-util-1/bin/apu-1-config
-- The CXX compiler identification is GNU 11.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/gcc/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found APR: -L/opt/apr-1.7.0/lib;-lapr-1
-- Found APR-Util: -L/opt/apr-util-1.6.1/lib;-laprutil-1
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found EXPAT: /usr/lib64/libexpat.so (found version "2.1.0")
-- Found PkgConfig: /bin/pkg-config (found version "0.27.1")
-- 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 smtp_create_session in esmtp
-- Looking for smtp_create_session in esmtp - not found
-- Looking for syslog
-- Looking for syslog - found
-- Found Boost: /opt/boost/lib/cmake/Boost-1.76.0/BoostConfig.cmake (found
version "1.76.0") found components: thread
-- Found Java: /bin/java (found version "11.0.11") found components: Development
--
--
-- log4cxx configuration summary:
--
-- Build shared library ............ : ON
-- Build tests ..................... : ON
-- Build site ...................... : OFF
-- Install prefix .................. : /opt/apache-log4cxx-0.12.0-RC1
-- C++ compiler .................... : /opt/gcc/bin/g++
-- log4cxx char API ................ : utf-8
-- log4cxx wchar API ............... : ON
-- log4cxx unichar API ............. : OFF
-- logchar type .................... : utf-8
-- charset ......................... : locale
-- Using libESMTP .................. : OFF
-- ODBC library .................... : OFF
-- syslog .......................... : ON
-- Qt support ...................... : OFF
-- shared_mutex implementation ..... : std::shared_mutex
-- Applications required for tests:
-- zip ............................. : /bin/zip
-- sed ............................. : /bin/sed
-- gzip ............................ : /bin/gzip
-- Configuring done
CMake Warning (dev) at src/test/cpp/xml/CMakeLists.txt:1 (add_executable):
Policy CMP0115 is not set: Source file extensions must be explicit. Run
"cmake --help-policy CMP0115" for policy details. Use the cmake_policy
command to set the policy and suppress this warning. File:
/root/logging-log4cxx/src/test/cpp/xml/domtestcase.cpp
This warning is for project developers. Use -Wno-dev to suppress it.CMake
Warning (dev) at src/test/cpp/xml/CMakeLists.txt:1 (add_executable):
Policy CMP0115 is not set: Source file extensions must be explicit. Run
"cmake --help-policy CMP0115" for policy details. Use the cmake_policy
command to set the policy and suppress this warning. File:
/root/logging-log4cxx/src/test/cpp/xml/xmllayouttest.cpp
This warning is for project developers. Use -Wno-dev to suppress it.CMake
Warning (dev) at src/test/cpp/xml/CMakeLists.txt:1 (add_executable):
Policy CMP0115 is not set: Source file extensions must be explicit. Run
"cmake --help-policy CMP0115" for policy details. Use the cmake_policy
command to set the policy and suppress this warning. File:
/root/logging-log4cxx/src/test/cpp/xml/xmllayouttestcase.cpp
This warning is for project developers. Use -Wno-dev to suppress it.--
Generating done
-- Build files have been written to: /root/logging-log4cxx/build
{code}
Make error:
{code:java}
[ 1%] Building CXX object src/main/cpp/CMakeFiles/log4cxx.dir/action.cpp.o
In file included from
/root/logging-log4cxx/src/main/include/log4cxx/logstring.h:28,
from /root/logging-log4cxx/src/main/cpp/action.cpp:17:
/root/logging-log4cxx/build/src/main/include/log4cxx/log4cxx.h:47:41: error:
‘shared_ptr’ in namespace ‘std’ does not name a template type
47 | #define LOG4CXX_PTR_DEF(T) typedef std::shared_ptr<T> T##Ptr;\
| ^~~~~~~~~~
/root/logging-log4cxx/src/main/include/log4cxx/helpers/object.h:109:1: note: in
expansion of macro ‘LOG4CXX_PTR_DEF’
109 | LOG4CXX_PTR_DEF(Object);
| ^~~~~~~~~~~~~~~
In file included from
/root/logging-log4cxx/src/main/include/log4cxx/rolling/action.h:22,
from /root/logging-log4cxx/src/main/cpp/action.cpp:18:
/root/logging-log4cxx/src/main/include/log4cxx/helpers/object.h:24:1: note:
‘std::shared_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include
<memory>’?
23 | #include <log4cxx/helpers/classregistration.h>
+++ |+#include <memory>
24 |
In file included from
/root/logging-log4cxx/src/main/include/log4cxx/logstring.h:28,
from /root/logging-log4cxx/src/main/cpp/action.cpp:17:
/root/logging-log4cxx/build/src/main/include/log4cxx/log4cxx.h:48:22: error:
‘weak_ptr’ in namespace ‘std’ does not name a template type
48 | typedef std::weak_ptr<T> T##WeakPtr
| ^~~~~~~~
/root/logging-log4cxx/src/main/include/log4cxx/helpers/object.h:109:1: note: in
expansion of macro ‘LOG4CXX_PTR_DEF’
109 | LOG4CXX_PTR_DEF(Object);
| ^~~~~~~~~~~~~~~
/root/logging-log4cxx/build/src/main/include/log4cxx/log4cxx.h:48:17: note:
‘std::weak_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include
<memory>’?
48 | typedef std::weak_ptr<T> T##WeakPtr
| ^~~
/root/logging-log4cxx/src/main/include/log4cxx/helpers/object.h:109:1: note: in
expansion of macro ‘LOG4CXX_PTR_DEF’
109 | LOG4CXX_PTR_DEF(Object);
| ^~~~~~~~~~~~~~~
In file included from
/root/logging-log4cxx/src/main/include/log4cxx/rolling/action.h:22,
from /root/logging-log4cxx/src/main/cpp/action.cpp:18:
/root/logging-log4cxx/src/main/include/log4cxx/helpers/object.h:122:6: error:
‘shared_ptr’ in namespace ‘std’ does not name a template type
122 | std::shared_ptr<Ret> cast(const std::shared_ptr<Type>& incoming)
| ^~~~~~~~~~
/root/logging-log4cxx/src/main/include/log4cxx/helpers/object.h:122:1: note:
‘std::shared_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include
<memory>’?
122 | std::shared_ptr<Ret> cast(const std::shared_ptr<Type>& incoming)
| ^~~
In file included from
/root/logging-log4cxx/src/main/include/log4cxx/logstring.h:28,
from /root/logging-log4cxx/src/main/cpp/action.cpp:17:
/root/logging-log4cxx/build/src/main/include/log4cxx/log4cxx.h:47:41: error:
‘shared_ptr’ in namespace ‘std’ does not name a template type
47 | #define LOG4CXX_PTR_DEF(T) typedef std::shared_ptr<T> T##Ptr;\
| ^~~~~~~~~~
/root/logging-log4cxx/src/main/include/log4cxx/rolling/action.h:84:1: note: in
expansion of macro ‘LOG4CXX_PTR_DEF’
84 | LOG4CXX_PTR_DEF(Action);
| ^~~~~~~~~~~~~~~
In file included from /root/logging-log4cxx/src/main/cpp/action.cpp:18:
/root/logging-log4cxx/src/main/include/log4cxx/rolling/action.h:24:1: note:
‘std::shared_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include
<memory>’?
23 | #include <log4cxx/helpers/pool.h>
+++ |+#include <memory>
24 |
In file included from
/root/logging-log4cxx/src/main/include/log4cxx/logstring.h:28,
from /root/logging-log4cxx/src/main/cpp/action.cpp:17:
/root/logging-log4cxx/build/src/main/include/log4cxx/log4cxx.h:48:22: error:
‘weak_ptr’ in namespace ‘std’ does not name a template type
48 | typedef std::weak_ptr<T> T##WeakPtr
| ^~~~~~~~
/root/logging-log4cxx/src/main/include/log4cxx/rolling/action.h:84:1: note: in
expansion of macro ‘LOG4CXX_PTR_DEF’
84 | LOG4CXX_PTR_DEF(Action);
| ^~~~~~~~~~~~~~~
/root/logging-log4cxx/build/src/main/include/log4cxx/log4cxx.h:48:17: note:
‘std::weak_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include
<memory>’?
48 | typedef std::weak_ptr<T> T##WeakPtr
| ^~~
/root/logging-log4cxx/src/main/include/log4cxx/rolling/action.h:84:1: note: in
expansion of macro ‘LOG4CXX_PTR_DEF’
84 | LOG4CXX_PTR_DEF(Action);
| ^~~~~~~~~~~~~~~
/root/logging-log4cxx/src/main/cpp/action.cpp: In member function ‘void
log4cxx::rolling::Action::run(log4cxx::helpers::Pool&)’:
/root/logging-log4cxx/src/main/cpp/action.cpp:42:14: error: ‘unique_lock’ is
not a member of ‘std’
42 | std::unique_lock<std::mutex> lock(mutex);
| ^~~~~~~~~~~
/root/logging-log4cxx/src/main/cpp/action.cpp:19:1: note: ‘std::unique_lock’ is
defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
18 | #include <log4cxx/rolling/action.h>
+++ |+#include <mutex>
19 |
/root/logging-log4cxx/src/main/cpp/action.cpp:42:36: error: expected
primary-expression before ‘>’ token
42 | std::unique_lock<std::mutex> lock(mutex);
| ^
/root/logging-log4cxx/src/main/cpp/action.cpp:42:38: error: ‘lock’ was not
declared in this scope; did you mean ‘clock’?
42 | std::unique_lock<std::mutex> lock(mutex);
| ^~~~
| clock
/root/logging-log4cxx/src/main/cpp/action.cpp: In member function ‘void
log4cxx::rolling::Action::close()’:
/root/logging-log4cxx/src/main/cpp/action.cpp:65:14: error: ‘unique_lock’ is
not a member of ‘std’
65 | std::unique_lock<std::mutex> lock(mutex);
| ^~~~~~~~~~~
/root/logging-log4cxx/src/main/cpp/action.cpp:65:14: note: ‘std::unique_lock’
is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’?
/root/logging-log4cxx/src/main/cpp/action.cpp:65:36: error: expected
primary-expression before ‘>’ token
65 | std::unique_lock<std::mutex> lock(mutex);
| ^
/root/logging-log4cxx/src/main/cpp/action.cpp:65:38: error: ‘lock’ was not
declared in this scope; did you mean ‘clock’?
65 | std::unique_lock<std::mutex> lock(mutex);
| ^~~~
| clock
make[2]: *** [src/main/cpp/CMakeFiles/log4cxx.dir/action.cpp.o] Error 1
make[1]: *** [src/main/cpp/CMakeFiles/log4cxx.dir/all] Error 2
make: *** [all] Error 2
{code}
Will GCC-11 be supported in 0.12.0?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)