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
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

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

Closed by  Sergej Pupykin (sergej)
Monday, 07 February 2022, 19:38 GMT
Reason for closing:  Fixed
Comment by Alex Dewar (billypilgrim) - Monday, 16 August 2021, 06:58 GMT Comment by Tim Yao (blazedspeeder) - Wednesday, 18 August 2021, 05:32 GMT
Try adding in CXXFLAGS `-std=c++17` for the file `/etc/makepkg.conf`. I was am trying to install ROS noetic too, so hopefully this tidbit helps you.
Comment by Tim Yao (blazedspeeder) - Wednesday, 18 August 2021, 05:35 GMT
actually that didn't help me. Sorry about that.
Comment by Tim Yao (blazedspeeder) - Wednesday, 18 August 2021, 07:03 GMT
Changing `/usr/include/log4cxx/boost-std-configuration.h` did the trick.

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

Comment by Phoenix.L (lanyusea) - Sunday, 29 August 2021, 12:41 GMT
Comment by Sergej Pupykin (sergej) - Tuesday, 25 January 2022, 14:31 GMT
probably fixed in log4cxx-0.12.1

Loading...