I have spent about 8 hours (no joke) trying to get filesystem
into my XCode 6.0 project. I have exhausted my Googling and all the Stack Overflow threads on the matter.
I will try to give you as much information as possible so that you can offer suggestions if you have any.
- I have followed these instructions for downloading and executing
tar --bzip2 -xf /path/to/boost_1_57_0.tar.bz2
on the Unix terminal. As far as I know, everything went fine. - I have added
#include <boost/filesystem.hpp>
to the appropriate place in my program. I had set my Header Search Paths appropriately (although now I can't remember where it was that I set those. XCode is so unintuitive!) - Compiled the library a la step 5 in the instructions
- In my thread here, I was told to "link with the
boost_system
library" and "don't forget-lboost_filesystem
". So I went to Build Settings and tried my best to include those. I've tried various combinations, and am still not sure what the heck I'm doing. See the screenshot here. When I try to compile my program, the error I get is
ld: library not found for -llibs_system clang: error: linker command failed with exit code 1 (use -v to see invocation)
But I know something is correct because if I move all those flags then I get 3 errors:
Undefined symbols for architecture x86_64:
"boost::system::system_category()", referenced from:
___cxx_global_var_init2 in main.o
"boost::system::generic_category()", referenced from:
___cxx_global_var_init in main.o
___cxx_global_var_init1 in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The structure of my boost_1_57_0
folder is
boost_1_57_0
boost
algorithm
align
align.hpp
aligned_alloc.hpp
.
.
align.hpp
.
.
aligned_storage.hpp
.
.
.
.
.
libs
accumulator
doc
example
index.html
test
algorithm
.
.
align
.
.
.
.
.
.
.
.
.