Hello, I am in the process, i.e. I just began to write a Rcpp-based package for a Windows environment. The purpose of that package will be to read out signals from a USB-connected hardware. The company who is selling this hardware is distributing a SDK for developing custom C-programms to read out those signals, so I have all the required files (.h, .lib, .dll) to compile a working .exe file -- and now, due to some reasons, I want to implement this code in an R-package, and read out the signals from the devices straight from within R. I am planning to expose the needed C-functions via modules to R, but, unfortunately, I did not even come that far: Here?s my problem: I do not know, i.e. it is not clear to me how to link / use the .lib file of the SDK in my package. (In the instructions coming with the SDK they write: "... copy the contents of "API \ lib" to your compiler?s lib directory) Is it possible that I have to use the LDFlags function in src/Makevars.win here somehow? If yes, then I do not know how to write the appropriate code.... I do have two .dll files (which I place in in the src-folder) and I suppose that I just write them into the Namespace-file using "useDynLib(NameOfTheFile)". But, as I was not able to compile the package yet, I do not know if this is right either... (And the .h file I just put into the src-folder....) Could someone, please, show me a way and the code of how to correctly link the .lib file in my package? Thank you very much, with best greetings from Austria, Bernhard Pollner -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110424/90fab9a3/attachment.htm>
[Rcpp-devel] How to link a .lib file in a rcpp-package in a Windows environment?
11 messages · Bernhard Pollner, Dirk Eddelbuettel
Hi Bernhard, Thanks for posting here!
On 24 April 2011 at 18:29, Bernhard Pollner wrote:
| Hello, | | I am in the process, i.e. I just began to write a Rcpp-based package for a | Windows environment. The purpose of that package will be to read out signals | from a USB-connected hardware. The company who is selling this hardware is | distributing a SDK for developing custom C-programms to read out those signals, | so I have all the required files (.h, .lib, .dll) to compile a working .exe | file -- and now, due to some reasons, I want to implement this code in an | R-package, and read out the signals from the devices straight from within R. I have done something similar in the part: use the .lib (or .dll) of a C library, presumably produced by a variant of Visual C++, in some MinGW compiled code for R. With C you can do this; with C++ you are most often out of luck due to name mangling of the functions. The actual act of mixing MinGW and a VC library is a topic in and by itself; I have found the MinGW documentation to be of help. I believe the FAQ has an entry for this. As I recall, you may need to do something about symbols being exported etc pp. I would also strongly recommend to just write a simple 'hello world' wrapper that just tries to access one function from the SDK via R first, ie outside of Rcpp. Once you have that working, mix it with Rcpp. The simplest use is to just drop the static library, with its full path, in the linker instructions. So instead of -lfoo just do C:/foo/sdk/lib/libfoo.a (and a relative path should work too). | I am planning to expose the needed C-functions via modules to R, but, | unfortunately, I did not even come that far: | | Here?s my problem: | I do not know, i.e. it is not clear to me how to link / use the .lib file of | the SDK in my package. | (In the instructions coming with the SDK they write: "... copy the contents of | "API \ lib" to your compiler?s lib directory) | Is it possible that I have to use the LDFlags function in src/Makevars.win here | somehow? If yes, then I do not know how to write the appropriate code.... | I do have two .dll files (which I place in in the src-folder) and I suppose | that I just write them into the Namespace-file using "useDynLib(NameOfTheFile) | ". | But, as I was not able to compile the package yet, I do not know if this is | right either... | (And the .h file I just put into the src-folder....) | | Could someone, please, show me a way and the code of how to correctly link the | .lib file in my package? All that R does (in the simple cases) is to use it own rules, augmented by the instructions in the file src/Makevars.win. So once you know how to build against the SDK (see above), just follow the usual 'how to build your package with Rcpp' guidelines in the Rcpp-package vignette and expand PKG_LIBS and PKG_CXXFLAGS in src/Makewin. Hope this helps, Dirk | Thank you very much, | with best greetings from Austria, | Bernhard Pollner | | | ---------------------------------------------------------------------- | _______________________________________________ | Rcpp-devel mailing list | Rcpp-devel at lists.r-forge.r-project.org | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Gauss once played himself in a zero-sum game and won $50.
-- #11 at http://www.gaussfacts.com
Hello Dirk, thanks for your quick answer. Due to my, unfortunately, profound lack of knowledge in this area I have to ask some additional (and probably quite stupid) questions regarding what you replied to me - see in the text below. Am 24.04.2011 um 20:12 schrieb Dirk Eddelbuettel:
Hi Bernhard, Thanks for posting here!
On 24 April 2011 at 18:29, Bernhard Pollner wrote: | Hello, | | I am in the process, i.e. I just began to write a Rcpp-based package for a | Windows environment. The purpose of that package will be to read out signals | from a USB-connected hardware. The company who is selling this hardware is | distributing a SDK for developing custom C-programms to read out those signals, | so I have all the required files (.h, .lib, .dll) to compile a working .exe | file -- and now, due to some reasons, I want to implement this code in an | R-package, and read out the signals from the devices straight from within R.
I have done something similar in the part: use the .lib (or .dll) of a C library, presumably produced by a variant of Visual C++, in some MinGW compiled code for R. With C you can do this; with C++ you are most often out of luck due to name mangling of the functions. The actual act of mixing MinGW and a VC library is a topic in and by itself; I have found the MinGW documentation to be of help. I believe the FAQ has an entry for this. As I recall, you may need to do something about symbols being exported etc pp.
OK, so I will check the FAQs of the MinGW documentation.
I would also strongly recommend to just write a simple 'hello world' wrapper that just tries to access one function from the SDK via R first, ie outside of Rcpp. Once you have that working, mix it with Rcpp.
How do I write a simple wrapper via R (without using Rcpp) for a function from the SDK? Or where can I start reading how to do that? Could you give me or point me to a code-example?
The simplest use is to just drop the static library, with its full path, in the linker instructions. So instead of -lfoo just do C:/foo/sdk/lib/libfoo.a (and a relative path should work too).
The "linker instructions", are they written in the file Makevars.win? If not, where are they? So, then in the right place, what EXACTLY should I then write in there for the .lib called e.g. "plastic.lib"? (And how do I write relative paths?)
| I am planning to expose the needed C-functions via modules to R, but, | unfortunately, I did not even come that far: | | Here?s my problem: | I do not know, i.e. it is not clear to me how to link / use the .lib file of | the SDK in my package. | (In the instructions coming with the SDK they write: "... copy the contents of | "API \ lib" to your compiler?s lib directory) | Is it possible that I have to use the LDFlags function in src/Makevars.win here | somehow? If yes, then I do not know how to write the appropriate code.... | I do have two .dll files (which I place in in the src-folder) and I suppose | that I just write them into the Namespace-file using "useDynLib(NameOfTheFile) | ". | But, as I was not able to compile the package yet, I do not know if this is | right either... | (And the .h file I just put into the src-folder....) | | Could someone, please, show me a way and the code of how to correctly link the | .lib file in my package?
All that R does (in the simple cases) is to use it own rules, augmented by the instructions in the file src/Makevars.win. So once you know how to build against the SDK (see above),
--- that means, once the missing .lib - file is correctly linked, or? --
just follow the usual 'how to build your package with Rcpp' guidelines in the Rcpp-package vignette and expand PKG_LIBS and PKG_CXXFLAGS in src/Makewin.
Sorry, and again my knowledge in this field is rather bad: how do I expand those flags, how do I add PKG_CXXFLAGS to the Makevars.win file? Could you give me, please, an exact example of what I would have to write for a library called e.g. "plastic.lib"?
Hope this helps, Dirk
Thank you very much for your efforts, with kind regards, Bernhard
Hi Bernhard,
On 24 April 2011 at 22:26, Bernhard Pollner wrote:
| Hello Dirk, | | thanks for your quick answer. | Due to my, unfortunately, profound lack of knowledge in this area I have to ask some additional (and probably quite stupid) questions regarding what you replied to me - see in the text below. | | Am 24.04.2011 um 20:12 schrieb Dirk Eddelbuettel: | | > | > Hi Bernhard, | > | > Thanks for posting here! | >
| >> On 24 April 2011 at 18:29, Bernhard Pollner wrote:
| >> | Hello,
| >> |
| >> | I am in the process, i.e. I just began to write a Rcpp-based package for a
| >> | Windows environment. The purpose of that package will be to read out signals
| >> | from a USB-connected hardware. The company who is selling this hardware is
| >> | distributing a SDK for developing custom C-programms to read out those signals,
| >> | so I have all the required files (.h, .lib, .dll) to compile a working .exe
| >> | file -- and now, due to some reasons, I want to implement this code in an
| >> | R-package, and read out the signals from the devices straight from within R.
| >
| > I have done something similar in the part: use the .lib (or .dll) of a C
| > library, presumably produced by a variant of Visual C++, in some MinGW
| > compiled code for R. With C you can do this; with C++ you are most often out
| > of luck due to name mangling of the functions.
| >
| > The actual act of mixing MinGW and a VC library is a topic in and by itself;
| > I have found the MinGW documentation to be of help. I believe the FAQ has an
| > entry for this. As I recall, you may need to do something about symbols
| > being exported etc pp.
|
| OK, so I will check the FAQs of the MinGW documentation.
|
| >
| > I would also strongly recommend to just write a simple 'hello world' wrapper
| > that just tries to access one function from the SDK via R first, ie outside
| > of Rcpp. Once you have that working, mix it with Rcpp.
|
| How do I write a simple wrapper via R (without using Rcpp) for a function from the SDK? Or where can I start reading how to do that?
| Could you give me or point me to a code-example?
A really simple (untested) one would be something like
#include "whicheverHeaderYouNeed.h" // adapt to what Plastic needs
SEXP simpleText(void) { // no arguments
Rprintf("hello world--before call\n");
// set up arguments as needed
someCallFromYourLibrarry(someArgs);
Rprintf("hello world--after call\n");
return R_NilValue; // because of the SEXP return value
}
See how you far you get with this...
| > The simplest use is to just drop the static library, with its full path, in
| > the linker instructions. So instead of -lfoo just do C:/foo/sdk/lib/libfoo.a
| > (and a relative path should work too).
|
| The "linker instructions", are they written in the file Makevars.win? If not, where are they?
| So, then in the right place, what EXACTLY should I then write in there for the .lib called e.g. "plastic.lib"?
| (And how do I write relative paths?)
In the very simplest case you can header headers and the library to the src/
directory of your sources. The Makevars.win may just be
PKG_CPPFLAGS=-I.
PKG_LIBS=nameOfTheLibrary.a
Ok?
| >> | I am planning to expose the needed C-functions via modules to R, but,
| >> | unfortunately, I did not even come that far:
| >> |
| >> | Here?s my problem:
| >> | I do not know, i.e. it is not clear to me how to link / use the .lib file of
| >> | the SDK in my package.
| >> | (In the instructions coming with the SDK they write: "... copy the contents of
| >> | "API \ lib" to your compiler?s lib directory)
| >> | Is it possible that I have to use the LDFlags function in src/Makevars.win here
| >> | somehow? If yes, then I do not know how to write the appropriate code....
| >> | I do have two .dll files (which I place in in the src-folder) and I suppose
| >> | that I just write them into the Namespace-file using "useDynLib(NameOfTheFile)
| >> | ".
| >> | But, as I was not able to compile the package yet, I do not know if this is
| >> | right either...
| >> | (And the .h file I just put into the src-folder....)
| >> |
| >> | Could someone, please, show me a way and the code of how to correctly link the
| >> | .lib file in my package?
| >
| > All that R does (in the simple cases) is to use it own rules, augmented by
| > the instructions in the file src/Makevars.win.
| >
| > So once you know how to build against the SDK (see above),
| --- that means, once the missing .lib - file is correctly linked, or? --
|
| > just follow the
| > usual 'how to build your package with Rcpp' guidelines in the Rcpp-package
| > vignette and expand PKG_LIBS and PKG_CXXFLAGS in src/Makewin.
|
| Sorry, and again my knowledge in this field is rather bad:
| how do I expand those flags, how do I add PKG_CXXFLAGS to the Makevars.win file?
| Could you give me, please, an exact example of what I would have to write for a library called e.g. "plastic.lib"?
See above.
Cheers, Dirk
|
|
| >
| > Hope this helps, Dirk
|
| Thank you very much for your efforts,
| with kind regards,
| Bernhard
|
|
Gauss once played himself in a zero-sum game and won $50.
-- #11 at http://www.gaussfacts.com
Hi Dirk, thank you for your answer. I tried to write a very simple, pure package (without Rcpp), with the C-File named "ROnlyTest", where I put the code like suggested by you. The Makevars.win contains now only: (*) PKG_CPPFLAGS=-I. PKG_LIBS=Plastic.lib Unfortunetely, I can not compile (fail at "Rcmd check ROnlyTest") --- and I get the following error-message: ROnlyTest.cpp:3:1: error: 'SEXP' does not name a type When I then write a "void" before the "SEXP", I get the error: expected initializer before 'simpleText' I am sure it is quite trivial, but I just do not know what to write as an "initializer".... , or to do this line just right. But, apart from that, when the only thing I write into the C-File is: #include "PlasticHeader.h" int x = CallAFunctionFromPlasticDotLib(); then Rcmd check runs through nice, and I can build and install this package. Does that mean that the linking of Plastic.lib from above (*) was succesful? In the latter case, now what would be the line I would have to add to Makevars.win, or how do I have to modify the PKG_LIBS Line in order to incorporate "Plastic.lib"? Thanks a lot, Bernhard
A really simple (untested) one would be something like
#include "whicheverHeaderYouNeed.h" // adapt to what Plastic needs
SEXP simpleText(void) { // no arguments
Rprintf("hello world--before call\n");
// set up arguments as needed
someCallFromYourLibrarry(someArgs);
Rprintf("hello world--after call\n");
return R_NilValue; // because of the SEXP return value
}
See how you far you get with this...
Bernhard,
On 25 April 2011 at 04:32, Bernhard Pollner wrote:
04:32 -- burning the midnight oil? ;-)
| Hi Dirk,
|
| thank you for your answer.
|
| I tried to write a very simple, pure package (without Rcpp), with the C-File named "ROnlyTest", where I put the code like suggested by you.
|
| The Makevars.win contains now only: (*)
| PKG_CPPFLAGS=-I.
| PKG_LIBS=Plastic.lib
|
| Unfortunetely, I can not compile (fail at "Rcmd check ROnlyTest") --- and I get the following error-message:
| ROnlyTest.cpp:3:1: error: 'SEXP' does not name a type
You need to include headers for R too, e.g.
#include <R.h>
#include <Rdefines.h>
and maybe
#include <Rinternals.h>
depending on what R data structure and functions you use. See the "Writing R
Extensions" manual, as well as simple R packages with C sources -- such as
e.g. my old digest package (which does not use Rcpp).
| When I then write a "void" before the "SEXP", I get the error:
| expected initializer before 'simpleText'
| I am sure it is quite trivial, but I just do not know what to write as an "initializer".... , or to do this line just right.
|
| But, apart from that, when the only thing I write into the C-File is:
| #include "PlasticHeader.h"
| int x = CallAFunctionFromPlasticDotLib();
| then Rcmd check runs through nice, and I can build and install this package. Does that mean that the linking of Plastic.lib from above (*) was succesful?
|
| In the latter case, now what would be the line I would have to add to Makevars.win, or how do I have to modify the PKG_LIBS Line in order to incorporate "Plastic.lib"?
You probably want to look at a few packages using external libraries; there
are a few that use the GSL. One of them is mvabund which also uses Rcpp. It
has
## This assumes that the LIB_GSL variable points to working GSL libraries
## It also assume that we can call Rscript to ask Rcpp about its locations
PKG_CPPFLAGS=-std=c++0x -I$(LIB_GSL)/include
PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas $(shell $(R_HOME)/bin/Rscript.exe -e "Rcpp:::LdFlags()")
but understand that the environment variable use here is 'just for CRAN' and
you do not have to worry about it.
You do need to understand what these two lines do though, which is why I
recommended that you start with something simple.
Hope this helps, Dirk
|
|
| Thanks a lot,
| Bernhard
|
|
|
|
| >
| >
| > A really simple (untested) one would be something like
| >
| >
| > #include "whicheverHeaderYouNeed.h" // adapt to what Plastic needs
| >
| > SEXP simpleText(void) { // no arguments
| >
| > Rprintf("hello world--before call\n");
| >
| > // set up arguments as needed
| > someCallFromYourLibrarry(someArgs);
| >
| > Rprintf("hello world--after call\n");
| >
| > return R_NilValue; // because of the SEXP return value
| > }
| >
| >
| > See how you far you get with this...
|
Gauss once played himself in a zero-sum game and won $50.
-- #11 at http://www.gaussfacts.com
Hello Dirk, Am 25.04.2011 um 04:54 schrieb Dirk Eddelbuettel:
You need to include headers for R too, e.g. #include <R.h> #include <Rdefines.h> and maybe #include <Rinternals.h>
I did that, so, the "final" C document looks like:
| > #include "plastic.h" // adapt to what Plastic needs #include <R.h> #include <Rdefines.h> #include <Rinternals.h>
> SEXP simpleText(void) { // no arguments
| >
| > Rprintf("hello world--before call\n");
| >
| > int x = aCallFromPlasticLibrary();
| >
| > Rprintf("hello world--after call\n");
| >
| > return R_NilValue
| > }
With that it works, Rcmd check runs through nicely, I can install the package. I do not know how to load and run "simpleText()", though, but that probably does not matter. So I assume that, without using Rcpp and having only PKG_CPPFLAGS=-I. PKG_LIBS=PsyREG.lib in the Makevars.win, things are ok.
| In the latter case, now what would be the line I would have to add to Makevars.win, or how do I have to modify the PKG_LIBS Line in order to incorporate "Plastic.lib"? You probably want to look at a few packages using external libraries; there are a few that use the GSL. One of them is mvabund which also uses Rcpp. It has ## This assumes that the LIB_GSL variable points to working GSL libraries ## It also assume that we can call Rscript to ask Rcpp about its locations PKG_CPPFLAGS=-std=c++0x -I$(LIB_GSL)/include PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas $(shell $(R_HOME)/bin/Rscript.exe -e "Rcpp:::LdFlags()")
Ok, I am working on that now, try to understand what it means and modify the lines to my own needs. I?let you know how things are going here soon... Meanwhile thanks a lot, Bernhard
but understand that the environment variable use here is 'just for CRAN' and you do not have to worry about it. You do need to understand what these two lines do though, which is why I recommended that you start with something simple. Hope this helps, Dirk |
Hi Bernhard,
On 25 April 2011 at 12:35, Bernhard Pollner wrote:
| Hello Dirk,
|
|
| Am 25.04.2011 um 04:54 schrieb Dirk Eddelbuettel:
|
| >
| > You need to include headers for R too, e.g.
| >
| > #include <R.h>
| > #include <Rdefines.h>
| >
| > and maybe
| >
| > #include <Rinternals.h>
|
| I did that, so, the "final" C document looks like:
|
|
| > | > #include "plastic.h" // adapt to what Plastic needs
| > #include <R.h>
| > #include <Rdefines.h>
| > #include <Rinternals.h>
| > > SEXP simpleText(void) { // no arguments
| > | >
| > | > Rprintf("hello world--before call\n");
| > | >
| > | > int x = aCallFromPlasticLibrary();
| > | >
| > | > Rprintf("hello world--after call\n");
| > | >
| > | > return R_NilValue
| > | > }
|
|
|
| With that it works, Rcmd check runs through nicely, I can install the package. I do not know how to load and run "simpleText()", though,
As Doug likes to say: "If everything else fails, consider reading the
documentation" :) All this is explained in 'Writing R Extensions' and you
need to know about it too when using Rcpp functions. Look up .Call() ....
but that probably does not matter. So I assume that, without using Rcpp and having only
| PKG_CPPFLAGS=-I.
| PKG_LIBS=PsyREG.lib
| in the Makevars.win, things are ok.
Ok, good.
| > | In the latter case, now what would be the line I would have to add to Makevars.win, or how do I have to modify the PKG_LIBS Line in order to incorporate "Plastic.lib"?
| >
| > You probably want to look at a few packages using external libraries; there
| > are a few that use the GSL. One of them is mvabund which also uses Rcpp. It
| > has
| >
| > ## This assumes that the LIB_GSL variable points to working GSL libraries
| > ## It also assume that we can call Rscript to ask Rcpp about its locations
| > PKG_CPPFLAGS=-std=c++0x -I$(LIB_GSL)/include
| > PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas $(shell $(R_HOME)/bin/Rscript.exe -e "Rcpp:::LdFlags()")
| >
|
| Ok, I am working on that now, try to understand what it means and modify the lines to my own needs.
| I?let you know how things are going here soon...
|
|
| Meanwhile thanks a lot,
Pleasure! You are making good progress.
Cheers, Dirk
| Bernhard
|
|
|
| > but understand that the environment variable use here is 'just for CRAN' and
| > you do not have to worry about it.
| >
| > You do need to understand what these two lines do though, which is why I
| > recommended that you start with something simple.
| >
| > Hope this helps, Dirk
| >
| > |
Gauss once played himself in a zero-sum game and won $50.
-- #11 at http://www.gaussfacts.com
1 day later
Hi Dirk, Am 25.04.2011 um 04:54 schrieb Dirk Eddelbuettel:
You need to include headers for R too, e.g. #include <R.h> #include <Rdefines.h> and maybe #include <Rinternals.h>
That worked, everything runs smoothly then. :-)
| .... now what would be the line I would have to add to Makevars.win, or how do I have to modify the PKG_LIBS Line in order to incorporate "Plastic.lib"? You probably want to look at a few packages using external libraries; there are a few that use the GSL. One of them is mvabund which also uses Rcpp. It has ## This assumes that the LIB_GSL variable points to working GSL libraries ## It also assume that we can call Rscript to ask Rcpp about its locations PKG_CPPFLAGS=-std=c++0x -I$(LIB_GSL)/include PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas $(shell $(R_HOME)/bin/Rscript.exe -e "Rcpp:::LdFlags()") but understand that the environment variable use here is 'just for CRAN' and you do not have to worry about it. You do need to understand what these two lines do though, which is why I recommended that you start with something simple.
:-) Success!!
I studied, found out what most of that means, and -- voila -- in the end the (very simple!! :-)) ) working version of Makevars.win is like that:
PKG_LIBS = Plastic.lib $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")
with Plastic.lib, which resides directly in src, being the library I wanted to link against.
It works, I can invoke the first simple functions from within R, I can enumerate the connected devices, clear the list and give back build-numbers and the like.
(But I fear the next questions are already forming on the horizon..... :-( )
Thank you very much for your help here,
with kind regards,
Bernhard Pollner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20110426/0a9cfceb/attachment.htm>
Hi Bernhard,
On 26 April 2011 at 17:55, Bernhard Pollner wrote:
| Am 25.04.2011 um 04:54 schrieb Dirk Eddelbuettel:
| You need to include headers for R too, e.g.
|
| #include <R.h>
| #include <Rdefines.h>
|
| and maybe
|
| #include <Rinternals.h>
|
| That worked, everything runs smoothly then. :-)
Yup, good!
| ## This assumes that the LIB_GSL variable points to working GSL libraries
| ## It also assume that we can call Rscript to ask Rcpp about its locations
| PKG_CPPFLAGS=-std=c++0x -I$(LIB_GSL)/include
| PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas $(shell $(R_HOME)/bin/
| Rscript.exe -e "Rcpp:::LdFlags()")
|
| but understand that the environment variable use here is 'just for CRAN'
| and
| you do not have to worry about it.
|
| You do need to understand what these two lines do though, which is why I
| recommended that you start with something simple.
|
|
| :-) Success!!
| I studied, found out what most of that means, and -- voila -- in the end the
| (very simple!! :-)) ) working version of Makevars.win is like that:
|
| PKG_LIBS = Plastic.lib $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")
Perfect!! No transformation needed for Plastic.lib, ie no export table
business and all that as discussed in the MinGW FAQ?
In that case maybe I should mention this use case in the Rcpp-FAQ....
| with Plastic.lib, which resides directly in src, being the library I wanted to
| link against.
|
| It works, I can invoke the first simple functions from within R, I can
| enumerate the connected devices, clear the list and give back build-numbers and
| the like.
|
| (But I fear the next questions are already forming on the horizon..... :-( )
We'll take it one step at a time. Just how you were able to decompose this
problem into manageable chunks, we'll just do the same with the next apparent roadblock.
| Thank you very much for your help here,
Always a pleasure.
Cheers, Dirk
Gauss once played himself in a zero-sum game and won $50.
-- #11 at http://www.gaussfacts.com
Hi Dirk,
in the end the
| (very simple!! :-)) ) working version of Makevars.win is like that:
| PKG_LIBS = Plastic.lib $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")
Perfect!! No transformation needed for Plastic.lib, ie no export table business and all that as discussed in the MinGW FAQ?
Actually, I did not read the MinGW FAQ, I got this idea from studying the source code of the "mvabund" package, and by having learnt what -l, -L and -I means for the compiler.
We'll take it one step at a time. Just how you were able to decompose this problem into manageable chunks, we'll just do the same with the next apparent roadblock.
Great. I suspect you?ll hear from me rather soon.... :-) with a bow from Innsbruck, Austria, Bernhard