Wrap the Rcpp headers in an #if/#endif. That way, when you our outside of R, the Rcpp code is skipped.
I used this idea in 2013-2014 to build in R using Rcpp, and the same code in Visual Studio. Dale Smith -----Original Message----- >From: Yue Li <[email protected]> >Sent: May 4, 2017 10:16 AM >To: [email protected] >Subject: [Rcpp-devel] Is there an easy way to convert Rcpp code to pure cpp >code to build a command line tool > >Dear List, > >This is probably a dumb question: > >Is there an easy way to convert Rcpp code to pure cpp code to build a command >line tool? > >I was thinking about something similar to the 'python setup.py install’ thing. >Once the software is built, the binary executable can be added to /usr/bin/ >and invoked directly on command line without the R environment. > >I apologize as the question seems to be spoiled in that i could write >everything in cpp in the first place ... > >many thanks! >Yue > > >_______________________________________________ >Rcpp-devel mailing list >[email protected] >https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel _______________________________________________ Rcpp-devel mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
