[R] (no subject)

From: Karim Bakir <rimbak_at_yahoo.fr>
Date: Fri 10 Feb 2006 - 02:28:42 EST


Hi,

Can you help me please.

I must developp an application with the logiciel R.

It 's an application for pricing. So I see it uses the langage C and I see on the net taht it 's possible in c++.

Use C++ it 's better than C , we know it.

However It says to use c++ with R , we must :

"
You need to do two things:

(a) Write a wrapper to export the symbols you want to call from R as extern "C".

(b) Include the C++ libraries in the link to make the DLL. Suppose X.cc contains your C++ code, and X_main.cc is the wrapper, as in the example in `Writing R Extensions'. Then build the DLL by (gcc)

     ...\bin\R CMD SHLIB X.cc X_main.cc
or (VC++, which requires extension .cpp)

     cl /MT /c X.cpp X_main.cpp
     link /dll /out:X.dll /export:X_main X.obj X_main.obj
or (Borland C++, which also requires extension .cpp)

     bcc32 -u- -WDE X.cpp X_main.cpp
and call the entry point(s) in X_R, such as X_main. Construction of static variables will occur when the DLL is loaded, and destruction when the DLL is unloaded, usually when R terminates.

Note that you will not see the messages from this example in the GUI console: see the next section.

This example used to be in package cxx_0.0-x.tar.gz in the src/contrib/Devel section on CRAN, and could be compiled as a package in the usual way on Windows. "

So it doesn't run ,

With C it 's ok but with c++ no no.

I dont understand and don' t know how write this wraper, because Compilateur Visual C++ compile C too, so I don't need wraper?

Too there is a black box used in Logiciel R it is writted in "R" with C it 'ok but with c++ it doesn't

Can you help me please.

Thank you very much

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Feb 10 03:17:08 2006

This archive was generated by hypermail 2.1.8 : Sat 11 Feb 2006 - 02:03:50 EST