[Rcpp-devel] Fwd: cannot compile qtdensity example on windows

John Buonagurio jbuonagurio at exponent.com
Tue May 20 17:56:07 CEST 2014


Hi Michele -

Another option is to #define STRICT_R_HEADERS to fix the macro redefinition problem for Realloc, Free and ERROR. See R_exts/RS.h in the R sources to see what this does. I'd also make sure R_NO_REMAP is defined for good measure.

#undef Realloc and #undef Free also works as Dirk suggested.

I also see that you're using Qt 5.2.1 so you may need to do some additional work to get it working. It will work fine with Qt 4. Please see my post below which lists tested and working package versions. I developed a large Qt 4 + RInside application on Windows starting from the QtDensity example and makefiles, and had zero problems.

http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-March/005463.html

John

| -----Original Message-----
| From: rcpp-devel-bounces at lists.r-forge.r-project.org [mailto:rcpp-devel-
| bounces at lists.r-forge.r-project.org] On Behalf Of Dirk Eddelbuettel
| Sent: Monday, May 19, 2014 3:14 PM
| To: Michele Gubian
| Cc: rcpp-devel at lists.r-forge.r-project.org
| Subject: Re: [Rcpp-devel] Fwd: cannot compile qtdensity example on windows
| 
| 
| On 19 May 2014 at 19:04, Michele Gubian wrote:
| | hi Dirk,
| |
| | I tried to do the following (I am not sure I understand your
| | suggestion, since I am a newbie)
| | - modified the order of -I options in g++. This made no difference.
| | Probably this was not what you meant.
| | -  I moved
| | #include <RInside.h>
| | after all the #include <QSomething> in  qtdensity.h Now the errors are
| | even more, and different from before. A reduced output obtained by
| | using g++ -E is reported below.
| |
| | Going back to the original error, g++ complains about Realloc and Free
| | definitions. This is similar to the problem in this post:
| | http://stackoverflow.com/questions/11588765/using-rcpp-with-windows-sp
| | ecific-includes
| |
| | but I don't know how to apply it to my case.
| 
| i)   Use the same #undef trick. Winston shows how in his own answer.
| 
| ii)  Set the compiler flag -fpermissive if need be, eg via an environment variable.
| 
| Dirk
| 
| --
| Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-devel at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel


More information about the Rcpp-devel mailing list