So, let's say you want to create Boost “Getting Started” examples and link them using the Xcode project, rather than creating them on the command line. You are trying to use only the header and it works great.
But then you take an example:
#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; } }
And you do the following:
- Create boost libraries using. / bjam install
- Open Xcode and create a new C ++ command-line utility project.
- Drag the libboost_regex.dylib file into the Products folder in the Groups and Files tree (checking the option that allows you to copy the file).
- Set the project parameters so that the header search paths point to the folder with the Boost extension
- Create and run a project!
Unfortunately, if you open the console (Run | Console), you will see an error that dylib cannot find:
dyld: Library not loaded: libboost_regex.dylib Referenced from: /Users/matt/Documents/Boost/test/GettingStarted/build/Debug/GettingStarted Reason: image not found
So, not knowing the best way to get Xcode for this, you copy dylib to your_project / build / debug / and it starts! Hooray!
The detail-oriented person that you are, you enter some things into the standard version to try:
> Subject: foo bar baz > foo bar baz
And then these are the segfaults.
Program received signal: "EXC_BAD_ACCESS".
ACK!
But do not be afraid. I know what the problem is! And if no one succeeds, I will send a solution after lunch.
boost regex xcode
Matthew lowe
source share