[prev in list] [next in list] [prev in thread] [next in thread]
List: r-devel
Subject: Re: [Rd] RStudio Calling C++ Visual Studio DLL
From: Dirk Eddelbuettel <edd () debian ! org>
Date: 2015-02-21 17:44:05
Message-ID: 21736.50149.390141.71546 () max ! nulle ! part
[Download RAW message or body]
On 21 February 2015 at 10:45, Alex Restrepo wrote:
| I'm a newbie to R and I am interested
| in seeing a simple example of calling a 3rd party Visual Studio generated DLL
| from RStudio. Does anyone have a simple example which also walks through the
| preliminary steps of setting up the INCLUDE path and the library path to either
| a DLL or LIB file ? I have tried to find an easy example, but thus far had no
| luck finding an example using Rcpp to communicate to a 3rd party visual studio
| DLL.
Please see "Question 2.9: Can I use Rcpp with Visual Studio" in the Rcpp FAQ
(eg at http://cran.rstudio.com/web/packages/Rcpp/vignettes/Rcpp-FAQ.pdf)
which we wrote about four years ago, but which still stands:
As a courtesy, the text of that Q and A is:
\subsection{Can I use \pkg{Rcpp} with Visual Studio ?}
Not a chance.
And that is not because we are meanies but because \proglang{R} and Visual
Studio simply do not get along. As \pkg{Rcpp} is all about extending
\proglang{R} with \proglang{C++} interfaces, we are bound by the available
toolchain. And \proglang{R} simply does not compile with Visual Studio. Go
complain to its vendor if you are still upset.
If you have expert-level understanding of C++ and Visual Studio, you can make
this work. Yet it will still remain unsupported for as long R itself does
not support Visual Studio / Visual C++. A potentially more reliably but
still rather painful process would be to write a C-language wrapper to every
function you want to need, and then call that. Cross-compiler linking works
for C, it does not for C++ due to unstandardized name wrangling.
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | edd@debian.org
______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic