Downloaded and installed latest RE2. When building simple test code with Xcode 5, build fails.
#include <iostream>
#include <string>
#include <re2/re2.h>
using namespace std;
int main(int argc, const char * argv[])
{
unsigned long ulValue = 0L;
string sMultiple;
string sMatch = "^(\\d+)([KkMm])";
string sData = "2M";
if (RE2::FullMatch(sData, sMatch, &ulValue, &sMultiple)) cout << "Match!" << endl;
return 0;
}
Version info:
Sub-Heading Here
re2-20130802
OS X v10.8.5
g++ --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include- dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn) Target: x86_64-apple-darwin12.5.0 Thread model: posix
Errors:
Sub-Heading Here
Undefined symbols for architecture x86_64:
"re2::RE2::RE2(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Note:
If I replace the string variables ( sData & sMatch ) with quoted strings, it builds, but has exception when run.
Sub-Heading Here
EXC_BAD_ACCESS
bool RE2::Arg::parse_string(const char* str, int n, void* dest) {
if (dest == NULL) return true;
reinterpret_cast<string*>(dest)->assign(str, n);
return true;
}