[Rcpp-devel] Rcpp::depends not picking up inst/include/

Thell Fowler tbfowler4 at gmail.com
Fri Nov 30 22:31:19 CET 2012


On Fri, Nov 30, 2012 at 2:04 PM, JJ Allaire <jj.allaire at gmail.com> wrote:
>> That section, if I'm reading correctly states that if the package (the
>> one from Rcpp::depends)  exports a plugin then it will add it to the
>> linkingtoPackages and if it doesn't then it won't and these are what
>> are processed by .buildClinkCppFlags.
>
> Line 371 adds the package to the list of linkingToPackages without any
> qualifications. Later we check for a plugin but absence of a plugin
> does not prevent the package's inst/include directory from added to
> the compilation.
>

OK, I see now.

> The behavior you are seeking is the intended behavior, so there must
> be something else going on here. I put together a simple package to
> try to reproduce the problem:
>
> https://github.com/jjallaire/TestPackageDepends
>
> After compiling and building the following code works fine for me:
>
> // [[Rcpp::depends(TestPackageDepends)]]
>
> #include <TestPackageDepends.h>
>
> #include <TestPackageDependsForwarder.h>
>
> // [[Rcpp::export]]
> void callFunction() {
>   TestPackageDepends::aFunction();
> }
>
> A possible problem: does myForwarder.h include only the definitions of
> forwarders or does it also include the definitions of exported
> functions. If it only has forwarders and you are trying to call
> exported functions then that would yield a compilation error (although
> it would have nothing to do with inst/include).

It has only the wrap as as definitions as there are no exported
functions (unless the wrap and as should be Rcpp::exported even though
this should be a header only package?).  I'll start the package from
scratch and build up until it either works or the problem is
recreated, and push that code.

Thanks for taking the time to get me to "see". :)
--
Sincerely,
Thell


More information about the Rcpp-devel mailing list