[Rcpp-devel] Compilation on MAC OS X 10.7.2

Rémi Lebret remi.lebret at math.univ-lille1.fr
Wed Dec 7 18:20:12 CET 2011


Hi,

I was including Rinternals.h before Rccp.h
As Rccp.h includes Rinternals.h, I don't need this inclusion and that fix the compilation error.

Thanks guys,

Rémi 

Le 7 déc. 2011 à 17:45, Dirk Eddelbuettel a écrit :

> 
> On 7 December 2011 at 16:55, Rémi Lebret wrote:
> | Hi,
> | 
> | I got this error when I'm trying to compile my package using Rcpp :
> | 
> | g++-4.2 -arch i386 -I/Library/Frameworks/R.framework/Resources/include -I/
> | Library/Frameworks/R.framework/Resources/include/i386  -I/usr/local/include -I"
> | /Library/Frameworks/R.framework/Versions/2.14/Resources/library/Rcpp/include"  
> | -fPIC  -g -O2 -c clusteringMain.cpp -o clusteringMain.o
> | In file included from /usr/include/c++/4.2.1/tr1/unordered_map:38,
> |                  from /Library/Frameworks/R.framework/Versions/2.14/Resources/
> | library/Rcpp/include/RcppCommon.h:130,
> |                  from /Library/Frameworks/R.framework/Versions/2.14/Resources/
> | library/Rcpp/include/Rcpp.h:27,
> |                  from clusteringMain.cpp:91:
> | /usr/include/c++/4.2.1/tr1/functional_hash.h: In member function ‘size_t
> | std::tr1::hash<std::basic_string<char, std::char_traits<char>, std::allocator
> | <char> > >::operator()(const std::string&) const’:
> | /usr/include/c++/4.2.1/tr1/functional_hash.h:144: error: ‘const struct
> | std::basic_string<char, std::char_traits<char>, std::allocator<char> >’ has
> | no member named ‘Rf_length’
> | /usr/include/c++/4.2.1/tr1/functional_hash.h: In member function ‘size_t
> | std::tr1::hash<std::basic_string<wchar_t, std::char_traits<wchar_t>,
> | std::allocator<wchar_t> > >::operator()(const std::wstring&) const’:
> | /usr/include/c++/4.2.1/tr1/functional_hash.h:156: error: ‘const struct
> | std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >
> | ’ has no member named ‘Rf_length’
> | make: *** [clusteringMain.o] Error 1
> | 
> | It looks like there is a problem with the tr1::unordered_map
> | 
> | Any help ?
> 
> ’ has no member named ‘Rf_length’ can happen when you get the header file
> includes misordered or otherwise messed up.  Someone calls 'length()' which
> should fall back to Rf_length but doesn't as it may have gotten redefined.
> 
> It's finicky due to R being C code using copious amounts of macros which can
> break.  Follow our package guidelines and stanzas and should be fine.
> 
> And, as Romain said, reduce it to a smaller problem. It is unlikely that
> there is a problem with tr1::unordered_map per se.
> 
> Dirk
> 
> | 
> | Rémi
> | 
> | Rémi Lebret
> | Ingénieur de recherche CNRS
> | Laboratoire de mathématiques de Lille1 - UMR 8524
> | Batiment M3 - Bureau 322
> | Tel: 03 20 43 67 82
> | remi.lebret at math.univ-lille1.fr
> | 
> | 
> | ----------------------------------------------------------------------
> | _______________________________________________
> | Rcpp-devel mailing list
> | Rcpp-devel at lists.r-forge.r-project.org
> | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
> -- 
> "Outside of a dog, a book is a man's best friend. Inside of a dog, it is too
> dark to read." -- Groucho Marx

Rémi Lebret
Ingénieur de recherche CNRS
Laboratoire de mathématiques de Lille1 - UMR 8524
Batiment M3 - Bureau 322
Tel: 03 20 43 67 82
remi.lebret at math.univ-lille1.fr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20111207/df3b3df8/attachment.htm>


More information about the Rcpp-devel mailing list