I am trying to compile c++ software depending on boost with CMake. With the same source code and CMakeLists.txt files, I succeeded with my own laptop (ubuntu 11 with boost1.42), but I am getting the following error message with my workstation (RHEL6.2 with boost 1.41) in research group (btw, boost1.41 should be enough):
main/main.cpp: In function ‘path
make_path(const std::string&)’:
main/main.cpp:50: error: invalid
conversion from ‘bool (*)(const std::string&)’ to ‘void*’
main/main.cpp:50: error:
initializing argument 2 of ‘boost::filesystem3::path::path(const Source&,
typename
boost::enable_if<boost::filesystem3::path_traits::is_pathable<typename
boost::decay<Source>::type>, void>::type*) [with Source =
std::basic_string<char, std::char_traits<char>, std::allocator<char> >]’
main/main.cpp: In function ‘int
main(int, char**)’:
main/main.cpp:664: error: ‘class
path’ has no member named ‘native_file_string’
main/main.cpp:676: error: ‘class
path’ has no member named ‘native_file_string’
make[2]: *** [main/CMakeFiles/vina_main.dir/main.cpp.o] Error 1
make[1]: *** [main/CMakeFiles/vina_main.dir/all] Error 2
make: *** [all] Error 2
I don't quite understand the error message and don't know how to fix it. Can anyone help me?
======================= update =========================
The above error message is fixed thanks to your help, but I still get the error message indicating linking failure between my executable file and boost libraries. I did link it within CMakeLists.txt by 'target_link_libraries (vvv_main vvv ${Boost_LIBRARIES})'. The error message is like:
CMakeFiles/vvv_main.dir/main.cpp.o: In function '__static_initialization_and_destruction_0':
/usr/local/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
.......
I read other related posts here, but still have no clue how to fix my problem. Thanks!
main.cpp
you're instantiating aboost::fileystem3::path
object. What is the second parameter you're passing to the constructor? - wilhelmtellpath::native_file_string
is deprecated and (I think) has been for a while. Whether Boost actually provides deprecated bits or not is controlled by a#define
; maybe it's defined differently on your two systems. - Gareth McCaughan