While including boost headers, I am getting not found error like the following-
fatal error: boost/config.hpp: No such file or directory
#include <boost/config.hpp>
I am using Mac OS X 10.9, and installed boost through brew. I can see all the boost headers at /usr/local/include/boost folder. How can I solve this problem?
Thanks in advance.
Assuming that /usr/local/include/boost/config.hpp exists, you need to add /usr/local/include to the compiler include search path; for gcc you can do this by adding -I /usr/local/include to the command line (or relevant part of the makefile).
What compiler are you using, and did you install it via homebrew?
Goto the following folder and find the installed boost library folder. I paste mine as an example folder path;
/usr/local/Cellar/boost/1.67.0_1
You need to find the most recent boost folder. If not there, you should install the boost library via brew
brew install boost
I'm assuming that you are using Xcode for your project. After the preceding steps, you need to add correct boost folder paths to your Xcode project. Open your Xcode project goto "Header Search Paths" and add the boost folder's parent folder path. Check the screenshot that I attached (ss-1 ss-1).
e.g. /usr/local/Cellar/boost/1.67.0_1/include/
for the Header Search Paths (ss-2 ss-2)
Also, you need to add Library Search Paths in your Xcode project.
e.g. /usr/local/Cellar/boost/1.67.0_1/lib/
for the Library Search Paths (ss-3 ss-3)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With