[R] dll under VC++ (c++ code)

Prof Brian D Ripley ripley at stats.ox.ac.uk
Wed May 10 13:10:23 CEST 2000


On Wed, 10 May 2000, nicolas baurin wrote:

> Bonjour R people,
> 
> Before to use "complex" c++ code under R (win95),
> i'm trying to import the c++ code that is in R-exts.pdf (section3.5).
> 
> I'm using Visual C++ 5.0.
> 
> So i've created a "win32 dll" project, added the 3 files (X.h, X.cpp and
> x_main.cpp as they're written in the document [X_main is C wrapped]) and
> builded a t.dll that i've copied to my R home directory.
> After a dyn.load("t.dll"), first problem, the Y static variable is not
> constructed and 2nd when i call .C("X_main"), i got:
>   Error in .C("X_main") : C/Fortran function name not in load table.
> 
> I suppose i did not build my dll like it should ... any help would be
> very welcome

Look in the rw-FAQ (always a good idea), as commands to build that example
under VC++ are given there.  And that has been tested under VC++6.0.  I
guess you forgot to export any symbols.

(I don't think you can know that the Y variable is not constructed, as
you have no access to vars in the DLL. In particular, C++ I/O
will not work from Rgui at least (it just might from Rterm).)


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list