From edd at debian.org  Mon Dec 18 14:40:35 2017
From: edd at debian.org (Dirk Eddelbuettel)
Date: Mon, 18 Dec 2017 07:40:35 -0600
Subject: [Rd] Rcpp - Linking to DLL from another package?
In-Reply-To: <9DD73F68AC266D4AA329E07B678177B1F059D92A@EE-MBX3.ee.emp-eaw.ch>
References: <9DD73F68AC266D4AA329E07B678177B1F059D92A@EE-MBX3.ee.emp-eaw.ch>
Message-ID: <23095.50515.694572.127889@bud.eddelbuettel.com>


(Moderately wrong list: r-package-devel for packaging questions, rcpp-devel
for Rcpp questions)

On 18 December 2017 at 13:24, Stravs, Michael wrote:
| I am trying to make a package B that extends another package A. Package A uses Rcpp, and I want to extend a class X used there.

It doesn't really matter (for the issue at hand) if you use Rcpp or not -- R
only offers us C interfaces so C interfaces are all we got. And they don't
know classes.

I worked through that in some of my packages. See eg RcppXts which "extends"
in your sense xts by allowing C++ level access from another package. The one
key aspect is that _everything you want to call from B must be explicitly
exported by A_.  See Writing R Extensions for details.

If you could rewrite your class A to be header-only then you could just
include it via LinkingTo. But that is a different story.

In short, "No Free Lunch" and no automagic mechanisms.

Dirk

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



[Rd] Rcpp - Linking to DLL from another package?
Dirk Eddelbuettel