Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems compiling C++ code with boost library

I am trying to compile the (thomas pevny's source code to calculate the subtractive pixels adjacency matrix). This code asks to previously install the libboost and libpng library, which i done successfully.

but when I do the 'make' command, the following errors appears 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 a way to fix this problem? Should I install another libboost version?

thanks for your attention.

like image 574
mad Avatar asked Feb 16 '23 05:02

mad


1 Answers

leaf() is deprecated.

See this list of functions that are deprecated 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; 
like image 186
Salgar Avatar answered Feb 24 '23 02:02

Salgar