<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"Lucida Console";
panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thank you. I will have a go at changing the directory when I upgrade to R-2.15.2 .<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Charles<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> JJ Allaire [mailto:jj.allaire@gmail.com] <br><b>Sent:</b> 11 January 2013 11:33<br><b>To:</b> Charles Cara<br><b>Cc:</b> rcpp-devel@lists.r-forge.r-project.org<br><b>Subject:</b> Re: [Rcpp-devel] Error when trying to your piSugar example<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Hi Charles,</span><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>I believe the problem is that the Rcpp package is installed in a directory with spaces in the path (C:/Program Files/R/R-2.15.1/library/) and that this is causing the problem. If you install into a library without spaces in the path everything should work correctly (see: <a href="http://stackoverflow.com/questions/9764495/how-to-get-rcpp-to-work-in-r-on-a-windows-xp-platform">http://stackoverflow.com/questions/9764495/how-to-get-rcpp-to-work-in-r-on-a-windows-xp-platform</a>)</span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-family:"Arial","sans-serif"'>J.J.</span><o:p></o:p></p><div><p class=MsoNormal>On Fri, Jan 11, 2013 at 6:11 AM, Charles Cara <<a href="mailto:CharlesC@absolute-strategy.com" target="_blank">CharlesC@absolute-strategy.com</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have been trying to experiment with Rcpp as it looks like it could be an excellent tool. However, I am unable to get your Finding Pi example (<a href="http://dirk.eddelbuettel.com/blog/2012/11/20/#rcpp_attributes_pi_example" target="_blank">http://dirk.eddelbuettel.com/blog/2012/11/20/#rcpp_attributes_pi_example</a> ) to work.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I have the C++ file and the R script, but sourceCpp fails. When I set showOutput and verbose to be TRUE then I get the following message. Looking through the message, it appears that the g++ command line does not have one of the parameters in quotes (highlighted in green) which is why it might be interpreted as two (missing) parameters.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>It is beyond my limited knowledge whether this is a bug or a problem with the configuration of my system, details of which are attached.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>If you have any suggestions on how to fix this, so that I can go on and use Rcpp, then I would be grateful.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Best regards<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Charles Cara<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";color:blue;background:#E1E2E5'>sourceCpp("src/piSugar.cpp", showOutput=TRUE, verbose=TRUE)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>Generated extern "C" functions </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>--------------------------------------------------------</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>#include <Rcpp.h></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span lang=FR style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>RcppExport SEXP sourceCpp_49731_piSugar(SEXP NSEXP) {</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>BEGIN_RCPP</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> Rcpp::RNGScope __rngScope;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> int N = Rcpp::as<int >(NSEXP);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> double __result = piSugar(N);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> return Rcpp::wrap(__result);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>END_RCPP</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>}</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>Generated R functions </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>-------------------------------------------------------</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>`.sourceCpp_49731_DLLInfo` <- dyn.load('C:/Users/charlesc/AppData/Local/Temp/RtmpO2NWdT/sourcecpp_16e8276073a/sourceCpp_69065.dll')</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>piSugar <- Rcpp:::sourceCppFunction(function(N) {}, `.sourceCpp_49731_DLLInfo`, 'sourceCpp_49731_piSugar')</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>rm(`.sourceCpp_49731_DLLInfo`)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>Building shared library</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>--------------------------------------------------------</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>DIR: C:/Users/charlesc/AppData/Local/Temp/RtmpO2NWdT/sourcecpp_16e8276073a</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>C:/PROGRA~1/R/R-215~1.1/bin/i386/R CMD SHLIB -o "sourceCpp_69065.dll" "piSugar.cpp" </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>g++ -I"C:/PROGRA~1/R/R-215~1.1/include" -DNDEBUG -I"C:/Program Files/R/R-2.15.1/library/Rcpp/include" -I"H:/Quantitative Strategy/R Working folder/3rd party examples/Rcpp and Pi/src" -I"C:/Program Files/R/R-2.15.1/library/Rcpp/include" -I"H:/Quantitative Strategy/R Working folder/3rd party examples/Rcpp and Pi/src/../inst/include" -O2 -Wall -mtune=core2 -c piSugar.cpp -o piSugar.o</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>g++ -shared -s -static-libgcc -o sourceCpp_69065.dll tmp.def piSugar.o <span style='color:#00B050'>C:/Program Files/R/R-2.15.1/library/Rcpp/lib/i386/libRcpp.a</span> -LC:/PROGRA~1/R/R-215~1.1/bin/i386 -lR</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>g++.exe: error: C:/Program: No such file or directory</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5'>g++.exe: error: Files/R/R-2.15.1/library/Rcpp/lib/i386/libRcpp.a: No such file or directory</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";color:#C5060B;background:#E1E2E5'>Error in inDL(x, as.logical(local), as.logical(now), ...) : </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";color:#C5060B;background:#E1E2E5'> unable to load shared object 'C:/Users/charlesc/AppData/Local/Temp/RtmpO2NWdT/sourcecpp_16e8276073a/sourceCpp_69065.dll':</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-size:10.0pt;font-family:"Lucida Console";color:#C5060B;background:#E1E2E5'> LoadLibrary failure: The specified module could not be found.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span lang=EN-US style='font-size:10.0pt;font-family:"Arial","sans-serif"'> </span><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:gray'>Charles Cara<br>Absolute Strategy Research Ltd.<br>1st Floor</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:gray'>1-2 Royal Exchange Buildings,<br>London, EC3V 3LF<br><br><a href="tel:%2B44%20207-073-0738" target="_blank">+44 207-073-0738</a> (direct line)<br><a href="tel:%2B44%20207-073-0732" target="_blank">+44 207-073-0732</a> (fax)</span><span style='color:gray'> <br></span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:gray'>--------------------------------------------------<br></span><span style='font-size:7.5pt;font-family:"Tahoma","sans-serif";color:gray'>Absolute Strategy Research Ltd is authorised and regulated by the Financial Services Authority. This email may contain confidential information intended only for use of the individual(s) named on this e-mail. If you are not the intended recipient, or responsible for delivery of the message to that person, you may not copy, disclose, or take any action in reliance of the contents of this email. If you have received this message in error, please notify us by return email immediately and destroy this message. The information in this email is intended only for investors who are Market Counterparties or Professional Customers, as defined by the FSA, and may not be distributed to Private Customers. Absolute Strategy Research Ltd does not solicit any action based upon this email, which is not to be construed as an invitation to buy or sell any security. Unless specifically stated to the contrary in the main body of the text, this email is not intended to provide personal investment advice, nor to take into account the investment objectives, financial situation and the particular needs of any particular person who may read it. This email provides general information only. The information contained was obtained from sources that we believe to be reliable but we do not guarantee that it is accurate or complete, and it should not be relied upon as such. Opinions expressed are our current opinions as of the original publication date appearing on this material only and the information, including the opinions contained herein, are subject to change without notice.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div></div><p class=MsoNormal><br>_______________________________________________<br>Rcpp-devel mailing list<br><a 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><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>