@@ -154,15 +154,24 @@ it.
154
154
155
155
Given a basic package with C++ support, we can now turn to integrating the external
156
156
package. This complexity of this step can, as alluded to earlier, vary from very easy to
157
- very complex. Simple cases include just depending on library headers which can either
158
- be copied to the package, or be provided by another package such as \pkg{BH}
159
- \citep{CRAN: BH }. It may also be a dependency on a fairly standard library available on
160
- most if not all systems. The graphics formats bmp, jpeg or png may be example; text
161
- formats like JSON or XML are another. One difficulty, though, may be that _ run-time_
162
- support does not always guarantee _ compile-time_ support. In these cases, a ` -dev ` or
163
- ` -devel ` package may need to be installed.
164
-
165
- In the concrete case of Corels, we
157
+ very complex. Simple cases include just depending on library headers which can either be
158
+ copied to the package, or be provided by another package such as \pkg{BH} \citep{CRAN: BH }
159
+ or \pkg{AsioHeaders} \citep{CRAN: AsioHeaders } or many other examples.
160
+
161
+ One aspect worth noting is that if you include a type in your function interface it will
162
+ also be part of the generated \code{RcppExports.cpp}. In this case adding a file
163
+ \code{PACKAGE\_ types.h} (where \code{PACKAGE} is to be replaced with the name of your
164
+ package) containing the required \code{\# include} statement for the type(s) will permit
165
+ compilation; see the 'Rcpp Attributes' vignette for details \citep{CRAN:Rcpp: Attributes }.
166
+
167
+ It may also be a dependency on a fairly standard library available on most if
168
+ not all systems. The graphics formats bmp, jpeg or png may be an example; text
169
+ formats like JSON or XML are another. One difficulty, though, may be that
170
+ _ run-time_ support does not always guarantee _ compile-time_ support. In these
171
+ cases, a ` -dev ` or ` -devel ` package may need to be installed.
172
+
173
+ Here, we use a third approach and copy files. Discussing the two other means
174
+ fully is beyond the scope of this shorter note. So in the concrete case of Corels, we
166
175
167
176
- copied all existing C++ source and header files over into the ` src/ ` directory;
168
177
- renamed all header files from ` *.hh ` to ` *.h ` to comply with an R preference;
0 commit comments