How do you install Boost on MacOS?
Download MacPorts, and run the following command:
sudo port install boost
how do i install boost on my mac?
You might use macports which simplifies the installation of boost significantly.
Download macports from http://www.macports.org/
Run
sudo port install boost
This will download an install boost automatically. And also install all dependencies of boost.Wait until boost is compiled. Takes about 0.5h on my macbook pro.
Your boost library is then found at
/opt/local/include/boost
How to install boost in OSX
You need to add the location of the include path in the compile command (this is where header files would be located). Often the compile command needs to have the include path, and would be similar to this:
g++ -I/usr/local/include test.cpp
However, the standard include path location above might not be the correct location, since on step (5):
The following directory should be added to compiler include paths:
/Users/lvzhi107/Downloads/boost_1_57_0
So in that case you would likely use:
g++ -I/Users/lvzhi107/Downloads/boost_1_57_0 test.cpp
If you encounter the same error again it might be recommended to step back and read the documentation more in depth, or perhaps use another means of installing boost such as MacPorts.
Related Topics
Accessing Certain Pixel Rgb Value in Opencv
Installing C++ Libraries on Os X
What Does '&' Do in a C++ Declaration
How to Programmatically Gain Root Privileges
How to Define a Template Function Within a Template Class Outside of the Class Definition
How to Cin Values into a Vector
C++ Equivalent to Java's Blockingqueue
Is It Safe to Push_Back an Element from the Same Vector
When Is Overloading Pass by Reference (L-Value and R-Value) Preferred to Pass-By-Value
How to Define a C++ Preprocessor MACro Through the Command Line with Cmake
Sharing a Global/Static Variable Between a Process and Dll
How to Use Boost Bind with a Member Function
Why User-Defined Move-Constructor Disables the Implicit Copy-Constructor