diff --git a/ChangeLog b/ChangeLog index b38efa574..b3e490f23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2019-11-20 Dirk Eddelbuettel + + * R/Attributes.R: Test for and report unavailable 'LinkingTo' package + 2019-11-19 Dirk Eddelbuettel * DESCRIPTION (Version, Date): Roll minor version diff --git a/R/Attributes.R b/R/Attributes.R index c911ba0f9..058d2c876 100644 --- a/R/Attributes.R +++ b/R/Attributes.R @@ -962,6 +962,11 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) { # otherwise check for standard Rcpp::interfaces generated include else if (!pluginsOnly) { pkgPath <- find.package(package, NULL, quiet=TRUE) + if (length(pkgPath) == 0) { + stop(paste("Package '", package, "' referenced from ", + "LinkingTo directive is not available.", sep=""), + call. = FALSE) + } pkgHeader <- paste(package, ".h", sep="") pkgHeaderPath <- file.path(pkgPath, "include", pkgHeader) if (file.exists(pkgHeaderPath)) {