I recently moved to C++11 and Xcode 5 with command line tools on OS X 10.9.1, installed boost 1.55 using Homebrew and changed the compiler from g++ to clang++ (as mentioned in this post: Error when with Xcode 5.0 and Rcpp). The compiler change fixed Rcpp when running in R. But I am having issues with compiling the RInside examples (which used to work just fine).
I re-downloaded RInside and unzipped the tar, went to the examples/standard directory and did a make clean
and make all
. It looks like any STL is not being linked to from this directory. How do I make RInside link to the appropriate STL in the Makefile?
I am using STL from Netbeans in a seperate project and building using clang++ works there. However, when I try an RInside project on Netbeans I get the same issue: Undefined symbols for architecture x86_64
. Do I need to download a 64 bit version of STL or of RInside somewhere ?
Am I still in need of updating/altering a config somewhere, did I download a wrong package or is it a setting in the Makefile for the examples that needs to change?
Here is the first call from make all
:
clang++ -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Versions/3.0/Resources/library/Rcpp/include -I/Library/Frameworks/R.framework/Versions/3.0/Resources/library/RInside/include -mtune=native -g -O2 -Wall -pedantic -Wconversion -Wall -I/usr/local/include rinside_callbacks0.cpp -F/Library/Frameworks/R.framework/.. -framework R -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/Library/Frameworks/R.framework/Resources/lib -lRlapack /Library/Frameworks/R.framework/Versions/3.0/Resources/library/Rcpp/lib/libRcpp.a /Library/Frameworks/R.framework/Versions/3.0/Resources/library/RInside/lib/libRInside.a -o rinside_callbacks0
The beginning of the output:
Undefined symbols for architecture x86_64:
"std::string::find_last_of(char, unsigned long) const", referenced from:
demangler_one(char const*) in libRcpp.a(api.o)
"std::string::find(char const*, unsigned long) const", referenced from:
short_file_name(char const*) in libRcpp.a(api.o)
"std::string::size() const", referenced from:
std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libRcpp.a(api.o)
MemBuf::add(std::string const&) in libRInside.a(MemBuf.o)
"std::string::c_str() const", referenced from:
RInside::parseEval(std::string const&, SEXPREC*&) in libRInside.a(RInside.o)
SEXPREC* Rcpp::pairlist<Rcpp::Function, Rcpp::traits::named_object<SEXPREC*>, Rcpp::traits::named_object<SEXPREC*> >(Rcpp::Function const&, Rcpp::traits::named_object<SEXPREC*> const&, Rcpp::traits::named_object<SEXPREC*> const&) in libRInside.a(RInside.o)
short_file_name(char const*) in libRcpp.a(api.o)
string_to_try_error(std::string const&) in libRcpp.a(api.o)
Rcpp::RObject::AttributeProxy::set(SEXPREC*) const in libRcpp.a(api.o)
demangle(std::string const&) in libRcpp.a(api.o)
Rcpp::RObject::AttributeProxy::get() const in libRcpp.a(api.o)
And at the end of the error messages:
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)