Boost library

Jul 21, 2011 at 4:21pm
Hi
I want to use boost filesystem part only on mac. For that I have builded the library. And extracted the filesystem library(from lib dir) and headers files into a separate folder since I want to include only filesystem in my project.

I have included the headers file and also the library path into my project. But getting some error as

1
2
3
4
5
6
7
n file included from /Volumes/Data/Temp/MY_ASSIGNMENT/BOOST/SAMPLE_PROGRAMS/BoostFS/main.cpp:2:
/Volumes/Data/Temp/MY_ASSIGNMENT/BOOST/SAMPLE_PROGRAMS/boost/include/boost/filesystem.hpp:15:69: error: boost/config.hpp: No such file or directory
In file included from /Volumes/Data/Temp/MY_ASSIGNMENT/BOOST/SAMPLE_PROGRAMS/boost/include/boost/filesystem.hpp:34,
                 from /Volumes/Data/Temp/MY_ASSIGNMENT/BOOST/SAMPLE_PROGRAMS/BoostFS/main.cpp:2:
/Volumes/Data/Temp/MY_ASSIGNMENT/BOOST/SAMPLE_PROGRAMS/boost/include/boost/filesystem/v3/config.hpp:29:84: error: boost/system/api_config.hpp: No such file or directory
/Volumes/Data/Temp/MY_ASSIGNMENT/BOOST/SAMPLE_PROGRAMS/boost/include/boost/filesystem/v3/config.hpp:30:40: error: boost/detail/workaround.hpp: No such file or directory
/Volumes/Data/Temp/MY_ASSIGNMENT/BOOST/SAMPLE_PROGRAMS/boost/include/boost/filesystem/v3/config.hpp:82:38: error: boost/config/auto_link.hpp: No such file or 
Jul 21, 2011 at 4:22pm
Also when i move the config.hpp file from filesystem folder into the boost directory then the first error goes but the all error except this remains.
Jul 21, 2011 at 4:23pm
Is it necessary to includes all other file into this or what?
Jul 21, 2011 at 8:12pm
For that I have builded the library. And extracted the filesystem library(from lib dir) and headers files into a separate folder since I want to include only filesystem in my project.


Don't do that.

Keep boost all together in one spot. Don't try to pick out pieces. Lots of areas of boost use other areas of boost. That's the problem you have here. You want to use only the filesystem portion, but the filesystem portion uses dozens of other areas of boost.

It doesn't hurt to keep it all together. Anything that you don't use will not adversely affect your program. The only thing it costs you is HD space.
Jul 21, 2011 at 11:44pm
Install boost via macports, then all you have to do is add /opt/local/include to your include path, and /opt/local/lib to your library path.

boost::filesystem is not header only and needs to link with libboost_filesystem and libboost_system.
Topic archived. No new replies allowed.