My CMakeLists.txt includes
add_definitions(-std=c++11)
And it compiles with the following warnings:
/usr/bin/ld: warning: libboost_filesystem.so.1.58.0, needed by /opt/ros/kinetic/lib/libroscpp.so, may conflict with libboost_filesystem.so.1.64.0
And it seg-faults when I run the executable.
Using gdb, I found the cause:
Thread 1 "pg_generator" received signal SIGSEGV, Segmentation fault.
0x00007ffff762935d in boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*) () from /usr/local/boost/1.64.0/stage/lib/libboost_filesystem.so.1.64.0
Seems like boost::filesystem is not working? Any ideas how to fix this?
I tried apt-get update and apt-get upgrade and rebooting. (I'm on Ubuntu 16.04.)
std::stringwhen going from gcc4 to gcc5, make sure both boost and your code is compiled with compatibly.