0
votes

I installed boost via

$ brew install boost

In xcode I have specified

/usr/local/Cellar/boost/1.65.1/include

in my header search path and

/usr/local/Cellar/boost/1.65.1/lib 

in my library search path. I can successfully

#include <boost/variant.hpp>

but when I try to include boost/filesystem.hpp I get the linker error:

Undefined symbols for architecture x86_64:
"boost::system::system_category()"

The directory /usr/local/Cellar/boost/1.65.1/include/boost does include filesystem.hpp.

I tried the solution here but it did not help with including boost/filesystem.hpp. What could be the issue?

Are there flags I should have used to install Boost?

1
What do you mean "it doesn't work"? Plase also state your question.tambre
I can include boost/variant.hpp, but including boost/filesystem.hpp doesn't work. I edited the question to include the linker error.interwebjill

1 Answers

2
votes

boost::system::system_category() is defined in libboost_system.{so,a}, so you need to

  1. add library path /usr/local/Cellar/boost/1.65.1/lib (or whatever that is), and
  2. link that library with -lboost_system linker option.

Auto-linking works on Windows only.