Duosora
Duosora

Reputation: 83

Issue compiling with Boost 1.56.0

I'm experiencing a problem. This is related to boost::filesystem. I'm getting this error: error: ‘class boost::filesystem::directory_entry’ has no member named ‘filename’. Have they deprecated it or what? The code is: string FileName = i->filename( );

Upvotes: 1

Views: 555

Answers (1)

sehe
sehe

Reputation: 392979

filename() is a member of path, not directory_entry.

Just do

std::string FileName = i->path().filename();

See it Live On Coliru

Upvotes: 1

Related Questions