Skip to content
Back to formatted view

Raw Message

Message-ID: <22656.63035.337282.882662@max.nulle.part>
Date: 2017-01-19T17:24:11Z
From: Dirk Eddelbuettel
Subject: [Rcpp-devel] How to use sourceCpp() to call a file with '.hpp'
In-Reply-To: <6a50efa4.8fef.159b77e75e5.Coremail.zkokia@163.com>

On 20 January 2017 at 00:10, Kokia Z wrote:
| I have found a .hpp file called fn_kron.hpp, and I have learned that sourceCpp
| () can be used to call c++ file to R. But when I wrote in this way, it returned
| the filename must be '.cpp', so how could I use sourceCpp to call this package?

You have a file ending in hpp.

sourceCpp wants a file ending in cpp.

Impasse? No, create a one-liner cpp file sourcing the hpp file. Or just rename.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org