From gregor.kastner at wu.ac.at  Wed Jan 22 11:53:41 2014
From: gregor.kastner at wu.ac.at (Gregor Kastner)
Date: Wed, 22 Jan 2014 11:53:41 +0100
Subject: [Rd] Linking to native routines in other packages
Message-ID: <20140122115341.66ebf717@mine>

Dear all,

in my package 'stochvol' I have unsuccessfully been trying to make a C
routine called 'sampler' available to be called from other packages' C code.

Following
http://cran.r-project.org/doc/manuals/R-exts.html#Linking-to-native-routines-in-other-packages
I have included

#include <R_ext/Rdynload.h>
R_init_stochvol(DllInfo *dll) {
 R_RegisterCCallable("stochvol", "sampler", (DL_FUNC) sampler);
}

in some file within stochvol's 'src' directory, and

DL_FUNC stochvol_sampler = R_GetCCallable("stochvol", "sampler");

in some file within the 'src' directoy of the package depending on stochvol.

When installing that package, I however get:

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  function 'sampler' not provided by package 'stochvol'

Can somebody give me a hint what I am missing?

Thanks a ton in advance!
Gregor



[Rd] Linking to native routines in other packages
Gregor Kastner