lagadic / vision_visp

ViSP stack for ROS
http://wiki.ros.org/vision_visp
GNU General Public License v2.0
184 stars 90 forks source link

Error with BOOST_FILESYSTEM_VERSION #16

Closed bchretien closed 10 years ago

bchretien commented 10 years ago

While trying to package vision_visp for Arch Linux (Boost 1.55), I had the following problem with visp_tracker:

/usr/include/boost/filesystem/config.hpp:16:5: error: #error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
 #   error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3
     ^

This is caused by this line:

# Make sure Boost.Filesystem v2 is used.
add_definitions(-DBOOST_FILESYSTEM_VERSION=2)

AFAIK, V2 support was removed in Boost 1.50, so this may be worth fixing, even for Ubuntu users.

Some functions were also removed: http://www.boost.org/doc/libs/1_45_0/libs/filesystem/v3/doc/deprecated.html

bchretien commented 10 years ago

The only API conflicts I had were with external_file_string():

/tmp/hydro/visp_tracker/src/visp_tracker/src/libvisp_tracker/file.cpp: In function ‘bool makeModelFile(boost::filesystem::ofstream&, std::string&)’:
/tmp/hydro/visp_tracker/src/visp_tracker/src/libvisp_tracker/file.cpp:77:24: error: ‘class boost::filesystem::path’ has no member named ‘external_file_string’
   fullModelPath = path.external_file_string();

With Boost Filesystem V3: external_file_string() ---> native()

bchretien commented 10 years ago

A patch that works for Arch: https://github.com/bchretien/vision_visp/commit/848362b2da6351ac889e01cb1a8a86151adff63c

This may also be valid for Fedora (cc @cottsay).

thomas-moulard commented 10 years ago

After checking Groovy does not support Ubuntu 10.04 which was our last reason to continue supporting Boost 1.40 (i.e. without the v3) so we can accept this patch.

Can you open a PR?

thomas-moulard commented 10 years ago

Actually, you can get a patch by just adding .patch to the URL so I applied it by myself :)

Thanks!

bchretien commented 10 years ago

@thomas-moulard thanks for the GitHub trick, I didn't even know that!