<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Dirk,</div><div><br></div><br><div><div>Am 25.04.2011 um 04:54 schrieb Dirk Eddelbuettel:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>You need to include headers for R too, e.g. <br><br> &nbsp;#include &lt;R.h&gt;<br> &nbsp;#include &lt;Rdefines.h&gt;<br><br>and maybe <br><br> &nbsp;#include &lt;Rinternals.h&gt;<br></div></blockquote><div><br></div><div>That worked, everything runs smoothly then. :-)</div><div><br></div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>| .... 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"?<br><br>You probably want to look at a few packages using external libraries; there<br>are a few that use the GSL. &nbsp;One of them is mvabund which also uses Rcpp. It<br>has <br><br>## This assumes that the LIB_GSL variable points to working GSL libraries<br>## It also assume that we can call Rscript to ask Rcpp about its locations<br>PKG_CPPFLAGS=-std=c++0x -I$(LIB_GSL)/include<br>PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas $(shell $(R_HOME)/bin/Rscript.exe -e "Rcpp:::LdFlags()")<br><br>but understand that the environment variable use here is 'just for CRAN' and<br>you do not have to worry about it.<br><br>You do need to understand what these two lines do though, which is why I<br>recommended that you start with something simple.<br></div></blockquote></div><br><div>:-) Success!!</div><div>I studied, found out what most of that means, and -- voila -- &nbsp;in the end the (very simple!! &nbsp;:-)) ) &nbsp;working version of Makevars.win is like that:</div><div><br></div><div><div>PKG_LIBS = Plastic.lib $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")</div></div><div>with Plastic.lib, which resides directly in src, being the library I wanted to link against.</div><div><br></div><div>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.</div><div><br></div><div>(But I fear the next questions are already forming on the horizon..... &nbsp; &nbsp;:-( &nbsp; )</div><div><br></div><div>Thank you very much for your help here,</div><div>with kind regards,</div><div>Bernhard Pollner</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></body></html>