Skip to content

dll under VC++ (c++ code)

2 messages · nicolas baurin, Brian Ripley

#
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

Cordialement,

Nicolas Baurin
Doctorant
ICOA
France


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Wed, 10 May 2000, nicolas baurin wrote:

            
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).)