Skip to content
Prev 2384 / 10988 Next

[Rcpp-devel] Error: .onLoad failed in loadNamespace()

Dear Romain,
On 31 May 2011 13:34, Romain Francois <romain at r-enthusiasts.com> wrote:
Warning still there, although possibly with a hint:

* checking whether the name space can be loaded with stated
dependencies ... WARNING
Error: .onLoad failed in loadNamespace() for ?anRpackage?, details:
  call: value[[3L]](cond)
  error: failed to load module yada from package anRpackage
could not find function "getClass"
Execution halted

A namespace must be able to be loaded with just the base namespace
loaded: otherwise if the namespace gets loaded by a saved object, the
session will be unable to start.

Probably some imports need to be declared in the NAMESPACE file.

I also updated R-devel; session information is:

R version 2.14.0 Under development (unstable) (2011-05-30 r56024)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_GB.utf8       LC_NUMERIC=C
 [3] LC_TIME=en_GB.utf8        LC_COLLATE=en_GB.utf8
 [5] LC_MONETARY=en_GB.utf8    LC_MESSAGES=en_GB.utf8
 [7] LC_PAPER=C                LC_NAME=C
 [9] LC_ADDRESS=C              LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C

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

other attached packages:
[1] Rcpp_0.9.4.2


Note that I observed this warning while working on a 'real' package.
In the hope to track its origin down and provide a reproducible
example, I realised that the warning also came up with the standard
Rcpp.package.skeleton output, which ended up in this thread. However,
to my surprise (and embarrassment), I do not have the warning in the
original package any more (whether with Rcpp 0.9.4.2 or 0.9.4.1). I
tried to revert some of the changes I did (moving Rcpp from Depends to
Imports for instance, removing the import(Rcpp) statement in the
NAMESPACE file,...) but without any success.

Not sure I am of any help here...

Best wishes,

Laurent