gagolews / ExampleRcppStringi

Access to the stringi API from within an Rcpp-based Project
https://stringi.gagolewski.com/
11 stars 2 forks source link

Package does not build #2

Closed koheiw closed 7 years ago

koheiw commented 7 years ago

Hi @gagolews,

I was so happy to find that stringi functions are exposed to C++, and jumped onto this package to learn how to use it in our quanteda package, but I am facing an error like this when I build the package (or source test.cpp). Can you give me advice on how to avoid this?

Thank you for making the amazing package.

In file included from /home/kohei/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include/Rcpp.h:67:0,
                 from test.cpp:2:
/home/kohei/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include/Rcpp/Nullable.h: In instantiation of ‘bool Rcpp::Nullable<T>::Rf_isNull() const [with T = Rcpp::Vector<14, Rcpp::PreserveStorage>]’:
/home/kohei/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include/Rcpp/Nullable.h:117:28:   required from ‘bool Rcpp::Nullable<T>::isNotNull() const [with T = Rcpp::Vector<14, Rcpp::PreserveStorage>]’
/home/kohei/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include/Rcpp/sugar/functions/sample.h:403:25:   required from here
/home/kohei/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include/Rcpp/Nullable.h:108:29: error: no matching function for call to ‘Rcpp::Nullable<Rcpp::Vector<14, Rcpp::PreserveStorage> >::Rf_isNull(SEXPREC* const&) const’
             return Rf_isNull(m_sexp);
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: KDE neon User Edition 5.9

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_3.3.2   Rcpp_0.12.9   stringi_1.1.2
gagolews commented 7 years ago

Took long, but a fix is there.

koheiw commented 7 years ago

Fantastic! Thank you @gagolews.