FS#71847 - [log4cxx] Missing #include in header
Attached to Project:
Community Packages
Opened by Alex Dewar (billypilgrim) - Monday, 16 August 2021, 06:57 GMT
Last edited by Sergej Pupykin (sergej) - Monday, 07 February 2022, 19:38 GMT
Opened by Alex Dewar (billypilgrim) - Monday, 16 August 2021, 06:57 GMT
Last edited by Sergej Pupykin (sergej) - Monday, 07 February 2022, 19:38 GMT
|
Details
I'm currently getting build issues when using log4cxx,
seemingly because of a missing #include in a header. In the
trace below, the compiler is also complaining about
C++14/C++17-only features being used, though this could be a
problem with the program I'm compiling (i.e. it's setting
the C++ standard to C++11 when it should be).
make[2]: *** [CMakeFiles/tf.dir/build.make:118: CMakeFiles/tf.dir/src/transform_listener.cpp.o] Error 1 In file included from /usr/include/log4cxx/log4cxx.h:45, from /usr/include/log4cxx/logstring.h:28, from /usr/include/log4cxx/level.h:22, from /opt/ros/noetic/include/ros/console.h:46, from /opt/ros/noetic/include/ros/ros.h:40, from /tmp/makepkg/ros-noetic-tf/src/geometry-1.13.2/tf/src/transform_broadcaster.cpp:34: /usr/include/log4cxx/boost-std-configuration.h:10:18: error: ‘shared_mutex’ in namespace ‘std’ does not name a type 10 | typedef std::shared_mutex shared_mutex; | ^~~~~~~~~~~~ /usr/include/log4cxx/boost-std-configuration.h:10:13: note: ‘std::shared_mutex’ is only available from C++17 onwards 10 | typedef std::shared_mutex shared_mutex; | ^~~ /usr/include/log4cxx/boost-std-configuration.h:12:30: error: ‘shared_lock’ in namespace ‘std’ does not name a template type 12 | using shared_lock = std::shared_lock<T>; | ^~~~~~~~~~~ /usr/include/log4cxx/boost-std-configuration.h:12:25: note: ‘std::shared_lock’ is only available from C++14 onwards 12 | using shared_lock = std::shared_lock<T>; | ^~~ In file included from /opt/ros/noetic/include/ros/console.h:46, from /opt/ros/noetic/include/ros/ros.h:40, from /tmp/makepkg/ros-noetic-tf/src/geometry-1.13.2/tf/src/transform_broadcaster.cpp:34: /usr/include/log4cxx/level.h:283:29: error: ‘mutex’ in namespace ‘std’ does not name a type 283 | static std::mutex initMutex; | ^~~~~ /usr/include/log4cxx/level.h:25:1: note: ‘std::mutex’ is defined in header ‘<mutex>’; did you forget to ‘#include <mutex>’? 24 | #include <log4cxx/helpers/object.h> +++ |+#include <mutex> 25 | |
This task depends upon
https://github.com/apache/logging-log4cxx/blame/master/src/main/include/log4cxx/level.h
change:
#define STD_SHARED_MUTEX_FOUND 1
#define Boost_SHARED_MUTEX_FOUND 0
to:
#define STD_SHARED_MUTEX_FOUND 0
#define Boost_SHARED_MUTEX_FOUND 1