[Rcpp-devel] #include gretl libraries in Rcpp

jean.p at hushmail.com jean.p at hushmail.com
Thu Dec 20 00:39:07 CET 2012


Hi,
I am having trouble getting Rcpp to compile c++ files including
headers from the gretl statistical libraries 
for instance, here are the first lines of a test cpp file I have been
trying to compile: 
#include 
extern "C" {#include #include }
now, here is the result of a make command in linux (debian), with the
error messages focussing on the lines of code where the #include are
located:
jean at desktop:~/Documents/code experiments/gretl$ make
PKG_CPPFLAGS="-I/usr/share/R/include -I/usr/lib/R/library/Rcpp/include
-I/usr/include/libxml2 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include  " PKG_LIBS="-L/usr/lib64/R/lib -lR
-L/usr/lib/R/library/Rcpp/lib -lRcpp
-Wl,-rpath,/usr/lib/R/library/Rcpp/lib -fopenmp -lgretl-1.0 -lxml2
-lfftw3 -lm -lglib-2.0  " R CMD SHLIB test2.cpp
make[1]: Entering directory `/home/jean/Documents/code
experiments/gretl'
g++ -I/usr/share/R/include -DNDEBUG -I/usr/share/R/include
-I/usr/lib/R/library/Rcpp/include -I/usr/include/libxml2
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include       -fpic  -O3
-pipe  -g  -c test2.cpp -o test2.o
In file included from /usr/include/gretl/libgretl.h:384,              
  from test2.cpp:4:/usr/include/gretl/genmain.h:33: error: expected
identifier before numeric constant/usr/include/gretl/genmain.h:33:
error: expected ‘}’ before numeric
constant/usr/include/gretl/genmain.h:33: error: expected
unqualified-id before numeric constant/usr/include/gretl/genmain.h:49:
error: expected constructor, destructor, or type conversion before
‘;’ token/usr/include/gretl/genmain.h:59: error: ‘R_MAX’ was
not declared in this scopetest2.cpp:6: error: expected declaration
before ‘}’ tokenmake[1]: *** [test2.o] Error 1make[1]: Leaving
directory `/home/jean/Documents/code experiments/gretl'make: ***
[test2.o] Error 1
any guidance would be really appreciated!
many thanks,jean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20121220/2c06ceb8/attachment.html>


More information about the Rcpp-devel mailing list