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

Daniel McCarthy danielmc999 at gmail.com
Sun Aug 30 22:39:16 CEST 2015


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.

Thank you again,
Dan




On Mon, Aug 24, 2015 at 10:37 AM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> On 24 August 2015 at 10:19, Daniel McCarthy wrote:
> |
> | I am attempting to push a package to CRAN but am having the following
> issue
> | with the CRAN checks:
> |
> | * using R version 3.1.3 (2015-03-09)
> | * using platform: x86_64-w64-mingw32 (64-bit)
> | ....
> | * checking compiled code ... NOTE
> | File 'perccal/libs/i386/perccal.dll':
> |   Found '_ZSt4cout', possibly from 'std::cout' (C++)
> |     Object: 'dboot_multi.o'
> | File 'perccal/libs/x64/perccal.dll':
> |   Found '_ZSt4cout', possibly from 'std::cout' (C++)
> |     Object: 'dboot_multi.o'
>
> See "Writing R Extensions"; this is not a Rcpp issue (though Rcpp offers
> you
> the Rcpp::Rcout "device" to send output to in order to have it synced with
> the R standard output).
>
> | This post referenced a similar issue: http://comments.gmane.org/
> | gmane.comp.lang.r.rcpp/3071
> |
> | A Google search seems to indicate many packages have similar
> notes:https://
> |
> www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=Found+
> | '_ZSt4cout'+note+package
> |
> | For example, bayes-tree:
> http://www2.uaem.mx/r-mirror/bin/windows/contrib/3.1/
> | check/BayesTree-check.log
> |
> | This is the only note remaining -- everything else went through without
> issue
> | and '_ZSt4cout' was not part of any code that I had written. I am
> importing
> | Rcpp and RcppArmadillo for 2 functions used in the package. I am
> stumped, but
>
> By default we take care of this:
>
>   // Rcpp has its own stream object which cooperates more nicely with R's
> i/o
>   // And as of Armadillo 2.4.3, we can use this stream object as well
>   #if !defined(ARMA_DEFAULT_OSTREAM)
>   #define ARMA_DEFAULT_OSTREAM Rcpp::Rcout
>   #endif
>
> Maybe you accidentally undefined this...
>
> | assume that I would not be allowed to push a package to CRAN which has
> this
> | note. Any help would be most appreciated!
>
> The message is rather explicit, something in the object code dboot_multi.o
> refers to std::cout.   You need to clean that up.
>
> (I think some folks have some clever macros in their headers to automate
> this.  I have in the past resorted to explicitly alterting code, or to
> macro
> use to switch to our Rcout as above.)
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150830/545d48f3/attachment.html>


More information about the Rcpp-devel mailing list