[Rcpp-devel] Rcpp::wrap segmentation fault

marc michalewicz marc.michalewicz at gmx.net
Sun Nov 21 13:46:45 CET 2010


Hi,

I use R 2.12.0 on Fedora FC13 and experience a segmentatioin fault when using a standard example from the artice "Rcpp: Seamless R and C++ integration" by D. Eddelbuettel:

When trying out this quite small and simple example:

<snip>
#include <Rcpp.h>

int main ()
{
  SEXP x;
  std::vector<std::map<std::string,int> > v;
  std::map<std::string, int> m1;             
  std::map<std::string, int> m2;             
  m1["foo"]=1; m1["bar"]=2;                  
  m2["foo"]=1; m2["bar"]=2; m2["baz"]=3;     
                                             
  v.push_back( m1 );                         
  v.push_back( m2 );                         
  x = Rcpp::wrap( v );
}

<snip>
(built with "g++ -g -I/usr/lib64/R/library/Rcpp/include -I/usr/include/R -L/usr/lib64/R/library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/lib64/R/library/Rcpp/lib -lRcpp example.cpp")

it results in a segmentation fault in libR during the call to wrap.

What is wrong ? Apart from this, my R installation works perfect, anything else too.

Thanks for any help on this,

Marc



-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail


More information about the Rcpp-devel mailing list