Referring to Writing R package that call Fortran library,
I have a very similar issue with my R package installation. I did install the package, but got an error in R after calling the library:
library(NEpidemic)
random_epi()
Error in .Fortran("random_epi", : "random_pi" not resolved from current namespace (NEpidemic)
Then I tried the same way as mentioned in the post by Ignacio, by adding useDynLib(random_epi) in the namespace file. But it gave an error saying that it couldn't install my package. Error:
Error in library.dynam(lib, package, package.lib) : shared object ‘random_epi.so’ not found
Error: loading failed
I could see the .so file for the package name, i.e. NEpidemic.so, but not for the subroutine codes in SRC folder. I can see only random_epi.o