(no subject)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

(no subject)

Karim Bakir

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]]

[hidden email] mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html