Problems compiling C ++ code with boost library

I am trying to compile the source code ( thomas pevny to calculate the pixel adjacency matrix ). This code asks you to preinstall the libboost and libpng library, which I successfully executed.

but when I do the make command, the following errors appear on the terminal.

spam.cpp:169:26: error: 'class boost::filesystem3::directory_entry' has no member named 'leaf' spam.cpp:179:20: error: 'class boost::filesystem3::path' has no member named 'native_file_string 

Is there any way to fix this problem? Should I install a different version of libboost?

Thank you for attention.

+4
source share
3 answers

leaf() deprecated.

See this list of deprecated features and their new names:

http://www.boost.org/doc/libs/1_45_0/libs/filesystem/v2/doc/index.htm

Edit for commment:

It should be something like this:

  boost::filesystem::path p("foo.txt"); std::cout << p.filename() << std::endl; 
+6
source

leaf() deprecated. See: http://www.boost.org/doc/libs/1_46_1/libs/filesystem/v3/doc/reference.html#directory_iterator-members You can try playing without BOOST_FILESYSTEM_NO_DEPRECATED .

+2
source

The problem was resolved with the suggestions of @Salgar and @ Jean-Baptiste Yunès, as well as adding -lboost_system after -lboost_filesystem in the makefile. Thanks to everyone.

0
source

Source: https://habr.com/ru/post/1486628/


All Articles