Skip to content
Back to formatted view

Raw Message

Message-ID: <19921.2941.443300.940406@max.nulle.part>
Date: 2011-05-16T11:33:17Z
From: Dirk Eddelbuettel
Subject: [Rcpp-devel] Re-using C++ code from a package with modules and defining linker flags using Rscript
In-Reply-To: <BANLkTimE0J30bz2sRg57qN_BU9fzfFT2Nw@mail.gmail.com>

On 16 May 2011 at 10:28, Jelmer Ypma wrote:
| Thanks for both your replies. I got it working the way I wanted. If
| someone's interested, a simple example with two packages can be
| downloaded here: http://www.ucl.ac.uk/~uctpjyy/downloads/RcppEx.zip
| 
| QuadFunc defines a C++ class that is used in C++ code in QuadFuncVec.

So you define function CxxFlags() and LdFlags() in your package just like we
do for Rcpp --- that is indeed just about the only way I could think of.

Glad know you got that working. 

Dirk

PS Also try 
   
   -e "QuadFunc:::CxxFlags()")

   instead of 

   -e "library(QuadFunc); QuadFunc:::CxxFlags()")

   as the ::: finds unexported symbols, that usually works from unloaded
   packages too.  And because of LinkingTo: QuadFunc you may not need the
   CxxFlags.
 
-- 
Gauss once played himself in a zero-sum game and won $50.
                      -- #11 at http://www.gaussfacts.com