gpt4 book ai didi

c++ - 我的代码的 Boost 更新问题

转载 作者:搜寻专家 更新时间:2023-10-31 02:19:58 24 4
gpt4 key购买 nike

我最近将 boost 更新到 1.59 并安装在/usr/local 中。我的系统默认安装在/usr/中,是 1.46。我正在使用 ubuntu 12.04。

我的代码库使用 ROS Hydro(机器人操作系统)。我有一个相当大的代码库,在更新之前运行良好。但是现在我明白了

terminate called after throwing an instance of 'boost::thread_interrupted'

我的堆栈跟踪

0x00007ffff573d0d5 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) where
#0 0x00007ffff573d0d5 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff574083b in __GI_abort () at abort.c:91
#2 0x00007ffff608f69d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff608d846 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff608d873 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff608d96e in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff7f1cc3e in boost::this_thread::interruption_point() () from /usr/local/lib/libboost_thread.so.1.59.0
#7 0x00007ffff7001752 in bool boost::condition_variable::timed_wait<boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000l> >(boost::unique_lock<boost::mutex>&, boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000l> const&) () from /opt/ros/hydro/lib/libroscpp.so
#8 0x00007ffff6fff429 in ros::CallbackQueue::callAvailable(ros::WallDuration) () from /opt/ros/hydro/lib/libroscpp.so
#9 0x00007ffff7045f90 in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*) () from /opt/ros/hydro/lib/libroscpp.so
#10 0x00007ffff702cd1b in ros::spin() () from /opt/ros/hydro/lib/libroscpp.so
#11 0x000000000041b795 in main ()

它显示异常源自 ros 核心库,这不应该发生。

可执行文件的 ldd 是:

    $ ldd devel/lib/visensor_node/visensor_nod
linux-vdso.so.1 => (0x00007ffff934d000)
libvisensor.so => /home/eeuser/ros_workspaces/HeloRosProject/devel/lib/libvisensor.so (0x00007f55489e10

00)
libopencv_core.so.2.4 => /opt/ros/hydro/lib/libopencv_core.so.2.4 (0x00007f55485b6000)
libopencv_calib3d.so.2.4 => /opt/ros/hydro/lib/libopencv_calib3d.so.2.4 (0x00007f5548321000)
libimage_transport.so => /opt/ros/hydro/lib/libimage_transport.so (0x00007f55480a0000)
libroslib.so => /opt/ros/hydro/lib/libroslib.so (0x00007f5547e8f000)
libroscpp.so => /opt/ros/hydro/lib/libroscpp.so (0x00007f5547b53000)
librosconsole.so => /opt/ros/hydro/lib/librosconsole.so (0x00007f554792d000)
libdynamic_reconfigure_config_init_mutex.so => /opt/ros/hydro/lib/libdynamic_reconfigure_config_init_mutex.so (0x00007f5547727000)
libroscpp_serialization.so => /opt/ros/hydro/lib/libroscpp_serialization.so (0x00007f5547524000)
librostime.so => /opt/ros/hydro/lib/librostime.so (0x00007f55472fd000)
libboost_system.so.1.46.1 => /usr/lib/libboost_system.so.1.46.1 (0x00007f55470cb000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5546eae000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5546bae000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f55468b1000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f554669b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f55462dc000)
libboost_thread.so.1.59.0 => /usr/local/lib/libboost_thread.so.1.59.0 (0x00007f55462b6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5548a79000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f554609f000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5545e97000)
libopencv_flann.so.2.4 => /opt/ros/hydro/lib/libopencv_flann.so.2.4 (0x00007f5545c24000)
libopencv_imgproc.so.2.4 => /opt/ros/hydro/lib/libopencv_imgproc.so.2.4 (0x00007f5545790000)
libopencv_features2d.so.2.4 => /opt/ros/hydro/lib/libopencv_features2d.so.2.4 (0x00007f55454e9000)
libmessage_filters.so => /opt/ros/hydro/lib/libmessage_filters.so (0x00007f55452e3000)
libtinyxml.so.2.6.2 => /usr/lib/libtinyxml.so.2.6.2 (0x00007f55450ce000)
libclass_loader.so => /opt/ros/hydro/lib/libclass_loader.so (0x00007f5544eb1000)
libboost_signals.so.1.46.1 => /usr/lib/libboost_signals.so.1.46.1 (0x00007f5544c9c000)
libboost_filesystem.so.1.46.1 => /usr/lib/libboost_filesystem.so.1.46.1 (0x00007f5544a7e000)
libconsole_bridge.so => /opt/ros/hydro/lib/libconsole_bridge.so (0x00007f5544874000)
librospack.so => /opt/ros/hydro/lib/librospack.so (0x00007f554462c000)
libboost_thread.so.1.46.1 => /usr/lib/libboost_thread.so.1.46.1 (0x00007f5544413000)
libxmlrpcpp.so => /opt/ros/hydro/lib/libxmlrpcpp.so (0x00007f55441f5000)
libcpp_common.so => /opt/ros/hydro/lib/libcpp_common.so (0x00007f5543fec000)
librosconsole_log4cxx.so => /opt/ros/hydro/lib/librosconsole_log4cxx.so (0x00007f5543dda000)
librosconsole_backend_interface.so => /opt/ros/hydro/lib/librosconsole_backend_interface.so (0x00007f5543bd8000)
liblog4cxx.so.10 => /usr/lib/liblog4cxx.so.10 (0x00007f55437f8000)
libboost_regex.so.1.46.1 => /usr/lib/libboost_regex.so.1.46.1 (0x00007f55434f6000)
libboost_system.so.1.59.0 => /usr/local/lib/libboost_system.so.1.59.0 (0x00007f55434f0000)
libPocoFoundation.so.9 => /usr/lib/libPocoFoundation.so.9 (0x00007f554319f000)
libboost_program_options.so.1.46.1 => /usr/lib/libboost_program_options.so.1.46.1 (0x00007f5542f39000)
libpython2.7.so.1.0 => /usr/lib/libpython2.7.so.1.0 (0x00007f5542a3c000)
libaprutil-1.so.0 => /usr/lib/libaprutil-1.so.0 (0x00007f5542818000)
libapr-1.so.0 => /usr/lib/libapr-1.so.0 (0x00007f55425df000)
libicuuc.so.48 => /usr/lib/libicuuc.so.48 (0x00007f5542275000)
libicui18n.so.48 => /usr/lib/libicui18n.so.48 (0x00007f5541eac000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5541ca8000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f5541a6b000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f554180c000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f5541431000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f554122e000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f5540ff4000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f5540dca000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f5540bc5000)
libicudata.so.48 => /usr/lib/libicudata.so.48 (0x00007f553f854000)

In particular this might be of interest :
$ ldd devel/lib/visensor_node/visensor_node | grep lib\boost
libboost_system.so.1.46.1 => /usr/lib/libboost_system.so.1.46.1 (0x00007fcc9abdb000)
libboost_thread.so.1.59.0 => /usr/local/lib/libboost_thread.so.1.59.0 (0x00007fcc99dc6000)
libboost_signals.so.1.46.1 => /usr/lib/libboost_signals.so.1.46.1 (0x00007fcc987ac000)
libboost_filesystem.so.1.46.1 => /usr/lib/libboost_filesystem.so.1.46.1 (0x00007fcc9858e000)
libboost_thread.so.1.46.1 => /usr/lib/libboost_thread.so.1.46.1 (0x00007fcc97f23000)
libboost_regex.so.1.46.1 => /usr/lib/libboost_regex.so.1.46.1 (0x00007fcc97006000)
libboost_system.so.1.59.0 => /usr/local/lib/libboost_system.so.1.59.0 (0x00007fcc97000000)
libboost_program_options.so.1.46.1 => /usr/lib/libboost_program_options.so.1.46.1 (0x00007fcc96a49000)

libvisensor.so 的 ldd

linux-vdso.so.1 =>  (0x00007fff7e3fe000)
libboost_thread.so.1.59.0 => /usr/local/lib/libboost_thread.so.1.59.0 (0x00007f29b4b60000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f29b4832000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f29b4536000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f29b4320000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f29b3f60000)
/lib64/ld-linux-x86-64.so.2 (0x00007f29b4c1d000)
libboost_system.so.1.59.0 => /usr/local/lib/libboost_system.so.1.59.0 (0x00007f29b3f5b000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f29b3d53000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f29b3b35000)

我注意到出于某些有趣的原因,两个 boost 库都是链接的,即。版本 1.46 和 1.59。我应该如何解决这个错误?

最佳答案

ROS Hydro 与 Boost 1.59 不兼容。如果你在安装 Boost 1.59 的同时还安装了 ROS Hydro,你将会遇到问题。正如在 ROS 答案的下一页中解释的那样,但我也会从中复制一段摘录以确保我的答案完整。

The source installation of ROS will compile with other versions of boost, but due to the possibility of binary incompatibility, the binary versions of ROS must be installed with the same version of boost that they were built with. If you'd like to use ROS with a version of boost other than the standard version, you'll have to build ROS from source.

http://answers.ros.org/question/170406/ros-hydro-and-boost-148/

关于c++ - 我的代码的 Boost 更新问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33230616/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com