Assuming that you have followed the steps on the previous post on Installing Boost on OSX and have copied the libraries /usr/local/include/boost
Note: If you have used MacPorts your libraries are stored in /opt/local/include/boost
1. Open XCode and create a new C++ Project
2. Click on the project to open the settings and search for a parameter called "Header Search Paths"
change it to /usr/local/include. Boost libraries should be copied here.
Boost XCode 4.4 Setup |
Boost First Program
#include <boost/array.hpp>
#include <iostream>
int main()
{
boost::array<int, 10>myarray;
myarray.fill(2);
for (int i=0; i<10; i++) {
std::cout << myarray.at(i) << std::endl;
}
return 0;
}
First Boost Program Download
No comments:
Post a Comment