我在 Windows 7 下编译 R 示例QtDensity 时遇到了一点问题。
我使用 Qt 5.6 因为它是使用 MinGW 4.9 编译的,与 RTools 34 相同的工具链。
以下是构建错误:
C:\Qt\Qt5.6.2\Tools\mingw492_32\i686-w64-mingw32\include\objidlbase.h:864: erreur : macro "Realloc" requires 3 arguments, but only 2 given
SIZE_T cb) = 0;
^
C:\Qt\Qt5.6.2\Tools\mingw492_32\i686-w64-mingw32\include\objidlbase.h:864: erreur : 'Realloc' declared as a 'virtual' field
SIZE_T cb) = 0;
^
C:\Progz\R-3.3.2\include\R_ext\RS.h:73: erreur : expected identifier before '(' token
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:\Progz\R-3.3.2\include\R_ext\RS.h:73: erreur : 'parameter' declared as function returning a function
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:\Progz\R-3.3.2\include\R_ext\RS.h:73: erreur : expected ')' before ',' token
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:\Progz\R-3.3.2\include\R_ext\RS.h:73: erreur : expected identifier before '(' token
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:\Progz\R-3.3.2\include\R_ext\RS.h:73: erreur : 'parameter' declared as function returning a function
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:\Progz\R-3.3.2\include\R_ext\RS.h:73: erreur : expected ')' before ',' token
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
它工作正常,在 (Arch)Linux 下根本没有任何调整。
我看了一下here,但是第一个答案中引起的线条形状很好。