I'm trying to build an R package which is calling some C subroutines via .Call.
All of the functions are working fine if I manually do R CMD SHLIB and then dyn.load the .dll files.
Now, I'm building the package with R CMD build.
I put all the C code in the src folder, together with the .h files for some libraries I'm adding. When I run R CMD build NAMEPACKAGE everything seems to be fine, but then when I run R CMD check NAMEPACKAGE I get the following errors:
*** arch - i386
Error in library.dynam(lib, package, package.lib) :
DLL 'NAMEFUNC' not found: maybe not installed for this architecture?
Error: loading failed
Execution halted
*** arch - x64
Error in library.dynam(lib, package, package.lib) :
DLL 'NAMEFUNC' not found: maybe not installed for this architecture?
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
I was trying to get some information on the internet, I have the feeling that I should write a Makevars file, but honestly I spent a lot of time on the Writing R extensions tutorial (1.2.1) and I'm really struggling to understand what is it exactly that I need to do. Could someone please beifly explain to me how to solve the problem? Consider I would like to submit my package to CRAN. Thanks.