<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=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (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:"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:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        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";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@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-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi<o:p></o:p></p><p class=MsoNormal>I am new to rcpp and am unable to compile code I know works. I must be doing something stupid. <o:p></o:p></p><p class=MsoNormal>I am using Windows (10).<o:p></o:p></p><p class=MsoNormal>I have received the cpp source files for the BHPMF package. We want to make the package work on the latest version of R.<o:p></o:p></p><p class=MsoNormal>I am currently using R 3.4.4 (the last version BHPMF works).<o:p></o:p></p><pre style='background:white;word-break:break-all'>I have installed rcpp (<span style='font-family:"Lucida Console";color:blue'>install.packages("Rcpp</span><span style='font-family:"Lucida Console";color:black'>"</span><span style='font-family:"Lucida Console";color:#0070C0'>)</span><span style='font-family:"Lucida Console";color:black'>).<o:p></o:p></span></pre><pre style='background:white;word-break:break-all'><span style='font-family:"Lucida Console";color:black'>I have installed RTools.<o:p></o:p></span></pre><pre style='background:white;word-break:break-all'><span style='font-family:"Lucida Console";color:black'>The source files are in J:\TempWork\BHPMF_CRAN_Archive\src<o:p></o:p></span></pre><pre style='background:white;word-break:break-all'><span style='font-family:"Lucida Console";color:black'>I am using the RTools C++ compiler in C:\Progs\Rtools\mingw_64\bin\c++.exe<o:p></o:p></span></pre><pre style='background:white;word-break:break-all'><span style='font-family:"Lucida Console";color:black'>When I try to compile, the compiler cannot find file R.h and ends with error message:<o:p></o:p></span></pre><pre style='background:white;word-break:break-all'><span style='font-family:"Lucida Console";color:black'><o:p> </o:p></span></pre><p class=MsoNormal>J:\TempWork\BHPMF_CRAN_Archive\src>C:\Progs\Rtools\mingw_64\bin\c++.exe HPMF_main.cpp<o:p></o:p></p><p class=MsoNormal>HPMF_main.cpp:11:35: fatal error: R.h: No such file or directory<o:p></o:p></p><p class=MsoNormal>#include <R.h>      // R functions<o:p></o:p></p><p class=MsoNormal>                                   ^<o:p></o:p></p><p class=MsoNormal>compilation terminated.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Can someone please tell me how I can tell the compiler to find R.h and the other files from the rcpp package?<o:p></o:p></p><p class=MsoNormal>I  compile from the command prompt. Is this the right way or must I do this in R?<o:p></o:p></p><p class=MsoNormal>Have I missed installing something? Have I installed staff in the wrong order?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks in advance.<o:p></o:p></p><p class=MsoNormal>Best wishes<o:p></o:p></p><p class=MsoNormal><a href="mailto:Gerhard_________________________boenisch@bgc-jena.mpg.de">Gerhard_________________________boenisch@bgc-jena.mpg.de</a><o:p></o:p></p><p class=MsoNormal>Scientific Data Manager<o:p></o:p></p><p class=MsoNormal>Dr. Gerhard Boenisch                     Phone: +49 3641 576277 <o:p></o:p></p><p class=MsoNormal><span lang=DE>MPI für Biogeochemie                   Fax:        +49 3641 577200<o:p></o:p></span></p><p class=MsoNormal><span lang=DE>Hans-Knoell Str. 10,                         07745 Jena,        Germany             <o:p></o:p></span></p><p class=MsoNormal><a href="http://www.bgc-jena.mpg.de/~boenisch"><span lang=DE>http://www.bgc-jena.mpg.de/~boenisch</span></a><span lang=DE><o:p></o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE><o:p> </o:p></span></p></div></body></html>