I have compiled the Boost from http://www.boost.org/ , and had no problems building it.
When testing it in Xcode, I had no problem with a small test program using the header-only library. I just had to set the Header Search Paths pointing to my folder where the boost source were (/Users/imyrvold/Documents/Tansa/cpp/boost_1_34_1).
But when I tested Xcode with a program, which shall link with a Boost binary library (which I have successfully built), I got problems. It built ok in Debug mode, but when running it, I got these messages:
Ivan-C-Myrvolds-MacBook:~/Documents/Tansa/cpp/testprojects/boost_example2/build/Debug imyrvold$ ./boost_example2 < jayne.txt ZeroLink: unknown symbol '__ZN5boost11basic_regexIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE9do_assignEPKcS7_j' Abort trap
The small program is this:
#include <boost/regex.hpp> #include <iostream> #include <string>
int main () { std::string line; boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
while (std::cin) { std::getline(std::cin, line); boost::smatch matches; if (boost::regex_match(line, matches, pat)) std::cout << matches[2] << std::endl; }
return 0; }
I think I have not linked against the Boost binary, but how do I do that?
Ivan |