search for: x_main

Displaying 7 results from an estimated 7 matches for "x_main".

Did you mean: _main
2004 Jun 09
1
About dll from c++ routine
...d::cout << "constructor X" << std::endl; } X::~X() { std::cout << "destructor X" << std::endl; } Y::Y() { std::cout << "constructor Y" << std::endl; } Y::~Y() { std::cout << "destructor Y" << std::endl; } // X_main.cc: #include "X.hh" extern "C" { void X_main () { X x; } } // extern "C" Then I followed the instructions in “R for windows FAQ” using the command: C:\temp>RCMD SHLIB X.CC X_MAIN.CC However, I got the following message: In file included from x_main.cc:2: x.hh:7...
2008 Mar 17
1
how to get access to C++ Objects
In the "Writing R Extensions" manual appears this example, to get access to C++ function using the R commands: R> dyn.load(paste("X", .Platform$dynlib.ext, sep = "")) constructor Y R> .C("X_main") constructor X destructor X list() That gives me access to the function "X_main", but how to get access to methods and properties like X.Z() and X.f, defined in the C++ files: // X.hh class X { public: int f; X (); ~X (); int Z(int a, int b); };...
2006 Feb 09
0
(no subject)
...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...
2006 Aug 01
2
A problem with R CMD SHLIB
Hi, I followed the example in "Writing R Extensions" to create a shared object in Windows, using the command R CMD SHLIB X.cc X_main.cc This was encountered: ../src/gnuwin32/MkRules:155: warning: overriding commands for target '.c.d' ../src/gnuwin32/MkRules:143: warning: ignoring old commands for target '.c.d' ../src/gnuwin32/MkRules:171: warning: overriding commands for target '.c.d' ../src/gnuwin32/M...
2011 Apr 20
1
FW: [Rcpp-devel] Question on 5.6 Interfacing C++ code
...sent my question about using R and C++ to the wrong list, ironically seeing as that list was called Rcpp. Anyway, I was directed to post my question here. To summarize my current question, I have found two commands that I want to be able to put into a package. The commands are 'R CMD SHLIB X.cc X_main.cc' and 'dyn.load(paste("X",.Platform$dynlib.ext,sep="")),' which I would like to run when my package is installed and maybe have the second command run again when my package is to be used. I've been trying to figure out the documentation and learn through exampl...
2003 Jul 07
1
Problems with a dll under windows
...based on the "Writing R extensions" manual. rtest.h -------- class X { public: X (); ~X (); void Give7(double*); }; class Y { public: Y (); ~Y (); }; rtest.cpp --------- #include <iostream.h> #include "rtest.h" static Y y; extern "C" { void X_main () { X x; } } X::X() { std::cout << "construct X" << std::endl; } X::~X() { std::cout << "destruct X" << std::endl; } Y::Y() { std::cout << "construct Y" << std::endl; } Y::~Y() { std::cout << "dest...
2006 Mar 13
1
Help on interfacing C++ with R
Hi, I am trying to set up a C++ library for my R code. I followed the R-extension manual but found out that the example of "X.cpp, X_main.cpp" is somewhat too simple. Here is my code: //lib4R.h testing for interfacing C++ with R -- using C++ library in R #include <iostream> using namespace std; class lib4R { public: lib4R(); ~lib4R(); int testIntDivision(int, int); double testDoubleMult...