I'm trying to use Boost for unit testing on Xcode and am having trouble getting things to link properly.
I put the boost download into the directory (on my Mac with Lion) /usr/local/boost_1_49_0. So that directory has subdirectories such as boost, doc, libs, more and others.
I'm starting with an ultra simple test that I just copied from the first step of an online tutorial:
Code:
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE Hello
#include <boost/test/unit_test.hpp>
int add(int i, int j) { return i + j; }
BOOST_AUTO_TEST_CASE(universeInOrder) {
BOOST_CHECK(add(2, 2) == 5);
}
And, when I click on target, I have under Search Paths > Header Search Paths for both debug and release: /usr/local/boost_1_49_0
That much made the error message disappear for my include that refers to boost.
But I can't figure out how to get the linker to work properly, so build keeps failing. My current error message is: Library not found for -lboost
I first tried under Linking > Other Linker Flags just using -lboost (again for both debug and release) and then under Search Paths > Library Search Paths, I've tried /usr/local/boost_1_49_0 as well as /usr/local/boost_1_49_0/boost and /usr/local/boost_1_49_0/libs but none of those seem to work, and I get the same error message.
Does anyone know how to set this up so that I can use Boost with Xcode?