[Rcpp-devel] Making R package with Rcpp Issue: Found '_ZSt4cout'

Dirk Eddelbuettel edd at debian.org
Mon Aug 31 00:20:01 CEST 2015


On 30 August 2015 at 16:39, Daniel McCarthy wrote:
| Thank you Dirk!  
| 
| The issue stemmed from my using RcppArmadillo's sample function.  Reference
| link here: 
| http://gallery.rcpp.org/articles/using-the-Rcpp-based-sample-implementation/
| 
| At the top of my .cpp file I had used the following code to be able to call
| upon that function: 
| 
| #include <armadillo>
| #include <RcppArmadilloExtensions/sample.h>
| //[[Rcpp::depends(RcppArmadillo)]]
| 
| 
| After I created another function that avoided my needing to call upon the
| function that required this, then going back to putting the usual stuff at the
| top of my .cpp file,
| 
| #include <RcppArmadillo.h>
| //[[Rcpp::depends(RcppArmadillo)]]
| 
| 
| the note went away.  

Look more closely.  I suspect the issue was likely caused you including

     #include <armadillo>

without also including our settings. So you get vanilla Armadillo -- without
our override.  If you did

     #include <RcppArmadillo.h>
     #include <RcppArmadilloExtensions/sample.h>
     // [[Rcpp::depends(RcppArmadillo)]]

I am fairly certain you would RcppArmadillo AND the desired sample() function
BUT NOT the dreaded cout.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list