<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Dirk,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span>Thank you for your fast reply!</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">With regard to your specific suggestions:</div><div style="color: rgb(0, 0,
 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">|Two suggestions.  First, try creating a simple package without MathGL just to<br>|make sure you have that process of going from sourceCpp via compileAttributes<br>|to a package licked.  </div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">Yes, I did successfully create a simple package (using RStudio) as a "warm-up" exercise (I created a package for the</div><div
 style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">classic gibbs.cpp function). I can load the package, and use the gibbs function as expected.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">|Second, and as an alternative, try it the other way<br>|without attributes.  There are a number of simple package that link to<br>|external libraries; you could pick any as an example. <br><br>I'm not quite sure what you mean by this one. Could you please give me a brief description/procedure as to how to do this? (I'm still a bit of </div><div style="color: rgb(0,
 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">a newbie with Rcpp...)</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br>|The linmk error rings a faint bell, but I cannot quite connect the dots. You<br>|don't by chance have two version of Rcpp installed -- in /usr/local and below<br>|/home/hp, say?<br></div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">No, I don't have two versions installed. Just to be sure, I removed what I had and re-installed (actually
 upgraded to 0.10.4). Same issue...</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;">After going some googling on this, the consensus seems to be that there's something awry with ldconfig or LD_LIBRARY_PATH environment variable setting.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times,
 serif; background-color: transparent; font-style: normal;">Thanks!</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'times new roman', 'new york', times, serif; background-color: transparent; font-style: normal;"><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Dirk Eddelbuettel <edd@debian.org><br> <b><span style="font-weight: bold;">To:</span></b> Jules Archer <jules.archer@ymail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "rcpp-devel@lists.r-forge.r-project.org" <rcpp-devel@lists.r-forge.r-project.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, July 9, 2013 10:35 PM<br> <b><span style="font-weight: bold;">Subject:</span></b>
 Re: [Rcpp-devel] (no subject)<br> </font> </div> <div class="y_msg_container"><br><br>Hi Jules,<br><br>On 9 July 2013 at 22:16, Jules Archer wrote:<br>| Hi,<br>| <br>| I've been trying to integrate the mathGL plotting library into R with Rcpp,<br>| with the ultimate goal of rendering in the browser.  So far, I've been<br>| successful with creating simple plotting test functions, compile with sourceCpp<br>| ("myplotter.cpp") and output *.png and *.json files for browser 3D plotting. <br><br>Cool.<br> <br>| However, when I try to compile as an R package, I keep getting the following<br>| error:<br>| <br>| ** building package indices<br>| ** testing if installed package can be loaded<br>| Error in dyn.load(file, DLLpath = DLLpath, ...) : <br>|   unable to load shared object '/usr/local/lib/R/site-library/mathGL/libs/<br>| mathGL.so':<br>|   /usr/local/lib/R/site-library/mathGL/libs/mathGL.so: undefined symbol:<br>|
 _ZTIN4Rcpp14not_compatibleE<br>| Error: loading failed<br>| Execution halted<br>| ERROR: loading failed<br>| <br>| The mathGL.so library was created and exists. For reference, I'm using the<br>| following flags in the Makevars file:<br>| <br>| PKG_CXXFLAGS=-"I/home/hp/Downloads/mathgl-2.1/include/mgl2" -lmgl<br>| PKG_LIBS=-L/usr/local/lib/<br>| <br>| Any ideas or thoughts as to what the "undefined symbol" error means and how to<br>| resolve this would be greatly appreciated.<br><br>Two suggestions.  First, try creating a simple package without MathGL just to<br>make sure you have that process of going from sourceCpp via compileAttributes<br>to a package licked.  Second, and as an alternative, try it the other way<br>without attributes.  There are a number of simple package that link to<br>external libraries; you could pick any as an example. <br><br>The linmk error rings a faint bell, but I cannot quite connect the dots. You<br>don't by
 chance have two version of Rcpp installed -- in /usr/local and below<br>/home/hp, say?<br><br>Dirk<br><br>| Thanks!<br>| <br>| ----------------------------------------------------------------------<br>| _______________________________________________<br>| Rcpp-devel mailing list<br>| <a ymailto="mailto:Rcpp-devel@lists.r-forge.r-project.org" href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>| <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>-- <br>Dirk Eddelbuettel | <a ymailto="mailto:edd@debian.org" href="mailto:edd@debian.org">edd@debian.org</a> | <a href="http://dirk.eddelbuettel.com/" target="_blank">http://dirk.eddelbuettel.com</a><br><br><br></div> </div> </div>  </div></body></html>