[Rcpp-devel] Help on compilation of Rcpp and RInside

deqiang sun deqiangs at bcm.edu
Thu Apr 7 08:00:57 CEST 2011


Hi all,

Could someone help me on compilation of the RInside/inst/examples/standard/rinside_sample0.cpp. This example is the project Rinside0 created by eclipse.

And here is the error message for build.

**** Build of configuration Debug for project Rinside0 ****
make all 
Building file: ../src/Rinside0.cpp
Invoking: GCC C++ Compiler
g++ -I/home/deqiangs/workspace/RInside -I/home/deqiangs/workspace/Rcpp -I/home/deqiangs/workspace/RInside/inst/include -I/home/deqiangs/workspace/Rcpp/inst/include -I/usr/local/lib64/R/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/Rinside0.d" -MT"src/Rinside0.d" -o"src/Rinside0.o" "../src/Rinside0.cpp"
Finished building: ../src/Rinside0.cpp
 
Building target: Rinside0
Invoking: GCC C++ Linker
g++  -o"Rinside0"  ./src/Rinside0.o   
./src/Rinside0.o: In function `main':
~/workspace/Rinside0/Debug/../src/Rinside0.cpp:17: undefined reference to `RInside::RInside(int, char const* const*, bool)'
~/workspace/Rinside0/Debug/../src/Rinside0.cpp:19: undefined reference to `RInside::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
~/workspace/Rinside0/Debug/../src/Rinside0.cpp:21: undefined reference to `RInside::parseEvalQ(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
~/workspace/Rinside0/Debug/../src/Rinside0.cpp:23: undefined reference to `RInside::~RInside()'
./src/Rinside0.o: In function `Rcpp::wrap(char const*)':
~/workspace/Rcpp/inst/include/Rcpp/internal/wrap.h:781: undefined reference to `Rf_mkString'
./src/Rinside0.o: In function `bool Rcpp::Environment::assign<char [15]>(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const (&) [15]) const':
~/workspace/Rcpp/inst/include/Rcpp/Environment.h:270: undefined reference to `Rcpp::Environment::assign(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, SEXPREC*) const'
./src/Rinside0.o:(.gcc_except_table+0x10): undefined reference to `typeinfo for Rcpp::binding_is_locked'
collect2: ld returned 1 exit status
make: *** [Rinside0] Error 1

How should I setup the environment so that the compiler/linker work seamlessly? I can not find any documentation on this.

Best regards,

Dsun




More information about the Rcpp-devel mailing list