I am implementing a program using the Boost libraries. The program is compiled on different platforms. I have no problems on Mac OS.
The same code generates compiler errors on different platforms. The compilers are different: on Mac OS I use gcc 4.2, on Linux gcc 4.4, ...
However, there are some errors which are very hard to explain.
I am using Boost 1.5.3. For example, I have this strange message:
In member function 'std::vector<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >* FolderReader::get_filenames()':
/home/u/projects/prj/src/batch/folderreader.cpp:119: error:
'canonical' is not a member of 'bf'
where bf is defined as namespace bf = boost::filesystem;
and canonical()
is invoked in this way: bf::canonical(pp).string()
with pp
set:
for(bf::directory_iterator it = bf::directory_iterator(p); it != bf::directory_iterator(); it++) {
bf::path pp = *it;
...
However, it should work according to the API here: http://www.boost.org/doc/libs/1_53_0/libs/filesystem/doc/reference.html#canonical
NOTE: Some other errors I have just corrected were of this type. I had to write:
obj.method1().method2()
as
class2 &obj2 = obj.method1();
obj2.method2();
otherwise I would receive an error message.
So... what's wrong with my invocation of boost::filesystem::canonical(...)
?