<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 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
span.gnvmtomchab
        {mso-style-name:gnvmtomchab;}
span.gnvmtomcabb
        {mso-style-name:gnvmtomcabb;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hello all,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m using Rstudio 0.97.306, R 2.15-2, and Rcpp 0.10.2 with Windows 7 Professional x64. I recently switched to using the build tool in Rstudio, however, my generated file RcppExports.cpp and RcppExports.R are checked into version control, so they are read-only. The build fails with<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>***************<o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>==> Rcpp::compileAttributes()<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:blue'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:#C5060B'>Error in eval(expr, envir, enclos) : <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:#C5060B'>  file io error: 'C:/Foundation/Common/RiskFinancialLibrary/Prototypes/FiservPrototypes/src/RcppExports.cpp'<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:#C5060B'>Calls: source ... withVisible -> eval -> eval -> <Anonymous> -> .Call<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:#C5060B'>Execution halted<o:p></o:p></span></p><p class=MsoNormal>***************<o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";color:black'><o:p> </o:p></span></p><p class=MsoNormal>I have them checked in as I need to modify RcppExports.cpp manually, after running compileAttributes(), to avoid compiling in Visual Studio (see below for explanation, if you are interested):<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue'>#ifndef</span><span style='font-size:9.5pt;font-family:Consolas'> _MSC_VER<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue'>#include</span><span style='font-size:9.5pt;font-family:Consolas'> <span style='color:#A31515'><Rcpp.h></span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue'>using</span><span style='font-size:9.5pt;font-family:Consolas'> <span style='color:blue'>namespace</span> Rcpp;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal>…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.5pt;font-family:Consolas;color:blue'>#endif<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I tried removing the generated key at the top of RcppExports.cpp since this is mentioned in the Rcpp Attributes Vignette. However, I still have the error. Perhaps I’ve misinterpreted section 3.5.2 “Generated Code”?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In order to avoid generating traffic on the list let me comment on why I’m wrapping RcppExports.cpp with _MSC_VER. My employer produces all applications and libraries in Visual Studio. I wrap my ANSI C++ classes with .NET managed C++ classes and build a .NET assembly. This allows me to use Rcpp to test my C++ implementations of models against a clean implementation in R and fulfill company requirements that I use Visual Studio unit tests for quality assurance. I can then deliver the assembly build to developers for use in their own projects. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I may turn the previous paragraph into a presentation for the Atlanta R User’s Group.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Dale Smith, Ph.D.<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Senior Financial Quantitative Analyst<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Risk & Compliance<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Fiserv<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Office: 678-375-5315<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><a href="http://www.fiserv.com/"><span style='color:blue'>www.fiserv.com</span></a></span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>