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

Dirk Eddelbuettel edd at debian.org
Wed May 21 13:36:26 CEST 2014


On 21 May 2014 at 11:24, Michele Gubian wrote:
| hi Dirk and John,
| 
| thanks for your help!
| qtdensity finally compiled on Windows! I applied the #undef suggestion
| by modifying the qtdensity.h like this:
| 
| #include <RInside.h>
| #undef Realloc
| #undef Free
| #include <QtGui>
| // ... all the other #include <QSomething>s
| 
| Would it be meaningful to apply this change for everyone? I mean,
| could those #undef be harmful for other OS or settings?
| I haven't checked what STRICT_R_HEADERS does.

That was explained in a few emails here, and is covered in "Writing R
Extensions". 

| Some side notes:
| 
| - The -fpermissive compile option did not seem to have any effect
| - warnings disappeared when I removed -Wextra
| - I had a problem with qmake generating makefiles where include paths
| are protected by single quotes, -I'include/path'. This caused g++
| ignoring those paths, so I manually changed single into double quotes.
| Probably this is due to me using the linux shell tools provided in
| RTools, but I am not sure. This problem is similar to the one reported
| here:
| http://qt-project.org/forums/viewthread/25911
| - qtdensity executes properly, except that I have to move the slider
| very very slowly, otherwise the program crashes with the following
| message: "This application has requested the Runtime to terminate it
| in an unusual way". This seems to happen when the bandwidth in the
| spinbox does not get updated quickly enough after the slider is moved.

That sounds flaky and is not what is was like before. Something may still be
amiss. 

Dirk
 
 
| 
| On 21 May 2014 04:42, Dirk Eddelbuettel <edd at debian.org> wrote:
| >
| > Hi John
| >
| > Thanks for the follow-up.
| >
| > On 20 May 2014 at 15:56, John Buonagurio wrote:
| > | 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.
| >
| > We do define R_NO_REMAP right at the top, and have for years.
| >
| > Maybe we need STRICT_R_HEADERS as well. To be seen. Might be easier if users
| > define it.
| >
| > | #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
| >
| > If there are updates we need to make for the Qt example, let me know.  I
| > checked over updating to Ubuntu 14.04 and things worked as expected.
| >
| > Dirk
| >
| >
| >
| > | 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
| > | _______________________________________________
| > | 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
| >
| > --
| > 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

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


More information about the Rcpp-devel mailing list