[Rd] R inline package

From: Troy Robertson <troy.robertson2_at_bigpond.com>
Date: Mon, 19 Mar 2012 09:32:22 +0700

Hi all,

I am having some problems with the inline package and maybe someone can point out what is going wrong?
I have developed a C++ library to assist with an S4 R project I have been working on for some time. I need to be able to include my package using the setCMethod() function but it fails to find library header files and/or the Rcpp.h header if I include that. Yet if I use the cfunction call first, the exact same setCMethod() call will then work. I am assuming the Rcpp plugin is being called because of the Rcpp=TRUE argument to cfunction(), which is setting up the paths to cause the success of the later setCMethod? I know the setCMethod() call will work without the includes argument, but I need to be able to add the include to my library, which also fails unless the cfunction() call has been made first.

I am using R-2.14.1, Windows 7, inline (0.3.8), Rcpp (0.9.10). I had to downgrade rTools to 2.14 because of the following problem I encountered building my dll originally:


code<-"return item;"
setCMethod("getSigItem", sig, body=code, includes=inc, Rcpp=TRUE, verbose=TRUE)

The above call fails with:
fatal error: Rcpp.h: No such file or directory

The following call works fine:
f<-cfunction(sig, body=code, includes=inc, cppargs=cppa, libargs=liba, Rcpp=TRUE, verbose=TRUE)

And now the same setCMethod call from above will work: setCMethod("getSigItem", sig, body=code, includes=inc, Rcpp=TRUE, verbose=TRUE)

Thanks for any help you can provide


R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 19 Mar 2012 - 02:30:29 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 19 Mar 2012 - 17:00:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive