【发布时间】:2016-09-02 18:08:32
【问题描述】:
我目前正在处理一个 Qt 5.5 项目,并希望对我的 R 解释器(我在我的 Windows 7 系统上使用 R 3-3-1)执行一些调用来执行一些统计信息计算。我必须准确地说我使用的是我配置为使用 MSVC 12.0 编译器的 Qt 5.5 MSVC 2013 套件。
当然,我已经安装了 R 包 Rcpp 和 RInside。
在 Dirk Eddelbuettel 在此主题上的工作之后,我尝试调整其 .pro 文件以使其工作the Qtdensity example,但在编译 .pro 文件时遇到问题。
实际上,这里是编译 .pro 文件产生的不同变量和标志的输出,以及我对这些的每个问题:
项目消息:R_HOME 是 C:\R\R-3.3.1 到目前为止,一切顺利...
项目消息:RLDFLAGS 是 -LC:/R/R-3.3.1/bin/x64 -lR -lm 可以吗?
项目消息:RBLAS 是 -LC:/R/R-3.3.1/bin/x64 -lRblas 可以吗?
项目消息:RLAPACK 是 -LC:/R/R-3.3.1/bin/x64 -lRlapack 可以吗?
项目消息:RCPPINCL 是 -IC:/R/R-3.3.1/library/Rcpp/include 似乎没问题..
项目消息:RCPPLIBS 应该不会是空的,对吧?...
项目消息:RINSIDEINCL 是 -IC:/R/R-3.3.1/library/RInside/include 似乎没问题...
项目消息:RINSIDELIBS 是“C:/R/R-3.3.1/library/RInside/lib/x64/libRInside.a”我应该改用 libRInside.dll 吗?
最后,当我尝试编译 Qtdensity 时,我遇到了以下错误:
C:\R\R-3.3.1\library\RInside\include\RInsideCommon.h:27: erreur : C1083: 无法打开包含文件: 'sys/time.h': 没有这样的文件或目录
当然,我不是高级 C++ 架构师,但如果有人可以帮助我找出应该根据我的系统和环境特性获取 .pro 文件的不同变量的值,那将是很棒的,因为我真的很想利用我在 R 中的学习时间并避免学习 Python -:)
最好的问候。
朱利安
----------编辑------------------------ ----
好的,这里有一些消息:
1) 我在 C:\R\R-3.3.1 目录下安装了 R 3.3.1。 2) 我还尝试创建一个名为 Mingw 32bit R 的新编译工具包,其配置为:
编译器:C:\R\Rtools\mingw_32\bin\g++.exe
调试器:C:\R\Rtools\mingw_32\bin\gdb.exe
Qt 版本:Qt 5.7.0 MingW 32 位。
我想我现在已经正确设置了 .pro 变量:
项目消息:R_HOME 是 C:\R\R-3.3.1
项目消息:RCPPFLAGS 是 -IC:/R/R-3.3.1/include -IC:/R/R-3.3.1/include/x64
项目消息:RLDFLAGS 是 -LC:/R/R-3.3.1/bin/x64 -lR -lm
项目消息:RBLAS 为 -LC:/R/R-3.3.1/bin/x64 -lRblas
项目消息:RLAPACK 是 -LC:/R/R-3.3.1/bin/x64 -lRlapack
项目消息:RCPPINCL 是 -IC:/R/R-3.3.1/library/Rcpp/include
项目消息:RCPPLIBS 是
项目消息:RINSIDEINCL 是 -IC:/R/R-3.3.1/library/RInside/include
项目消息:RINSIDELIBS 是“C:/R/3.3.1/library/RInside/lib/x64/libRInside.a”
....但是在编译时,我收到以下错误...
C:/R/Rtools/mingw_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Program Files/R/R-3.0.3/library/RInside/examples/qt/build-qtdensity-Mingw_32_bit_Rtools-Debug'
g++ -c -pipe -fno-keep-inline-dllexport -IC:/R/R-3.3.1/include -IC:/R/R-3.3.1/include/x64 -IC:/R/R-3.3.1/library/Rcpp/include -IC:/R/R-3.3.1/library/RInside/include -g -std=gnu++11 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../../qt -I. -IC:/Qt/5.7/mingw53_32/include -IC:/Qt/5.7/mingw53_32/include/QtSvg -IC:/Qt/5.7/mingw53_32/include/QtWidgets -IC:/Qt/5.7/mingw53_32/include/QtGui -IC:/Qt/5.7/mingw53_32/include/QtANGLE -IC:/Qt/5.7/mingw53_32/include/QtCore -Idebug -IC:/Qt/5.7/mingw53_32/mkspecs/win32-g++ -o debug/qtdensity.o ../qtdensity.cpp
In file included from C:/R/Rtools/mingw_32/i686-w64-mingw32/include/combaseapi.h:155:0,
from C:/R/Rtools/mingw_32/i686-w64-mingw32/include/objbase.h:14,
from C:/R/Rtools/mingw_32/i686-w64-mingw32/include/ole2.h:17,
from C:/R/Rtools/mingw_32/i686-w64-mingw32/include/wtypes.h:12,
from C:/R/Rtools/mingw_32/i686-w64-mingw32/include/winscard.h:10,
from C:/R/Rtools/mingw_32/i686-w64-mingw32/include/windows.h:97,
from C:/Qt/5.7/mingw53_32/include/QtCore/qt_windows.h:61,
from C:/Qt/5.7/mingw53_32/include/QtGui/qopengl.h:49,
from C:/Qt/5.7/mingw53_32/include/QtGui/qopenglcontext.h:60,
from C:/Qt/5.7/mingw53_32/include/QtGui/QtGui:32,
from ../qtdensity.h:13,
from ../qtdensity.cpp:8:
C:/R/Rtools/mingw_32/i686-w64-mingw32/include/objidlbase.h:864:18: error: macro "Realloc" requires 3 arguments, but only 2 given
SIZE_T cb) = 0;
^
C:/R/Rtools/mingw_32/i686-w64-mingw32/include/objidlbase.h:864:22: error: 'Realloc' declared as a 'virtual' field
SIZE_T cb) = 0;
^
In file included from C:/R/R-3.3.1/include/R.h:75:0,
from C:/R/R-3.3.1/library/Rcpp/include/Rcpp/r/headers.h:52,
from C:/R/R-3.3.1/library/Rcpp/include/RcppCommon.h:29,
from C:/R/R-3.3.1/library/Rcpp/include/Rcpp.h:27,
from C:/R/R-3.3.1/library/RInside/include/RInsideCommon.h:38,
from C:/R/R-3.3.1/library/RInside/include/RInside.h:26,
from ../qtdensity.h:11,
from ../qtdensity.cpp:8:
C:/R/R-3.3.1/include/R_ext/RS.h:71:37: error: expected identifier before '(' token
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:/R/R-3.3.1/include/R_ext/RS.h:71:47: error: 'parameter' declared as function returning a function
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:/R/R-3.3.1/include/R_ext/RS.h:71:50: error: expected ')' before ',' token
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:/R/R-3.3.1/include/R_ext/RS.h:71:37: error: expected identifier before '(' token
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:/R/R-3.3.1/include/R_ext/RS.h:71:47: error: 'parameter' declared as function returning a function
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
C:/R/R-3.3.1/include/R_ext/RS.h:71:50: error: expected ')' before ',' token
#define Free(p) (R_chk_free( (void *)(p) ), (p) = NULL)
^
Makefile.Debug:797: recipe for target 'debug/qtdensity.o' failed
显然,一些包含文件仍然存在问题(是由于 Qt 5.7.0 框架/mingw 编译的库与 RTools 提供的 Mingw 版本之间的差异吗?有什么想法吗?
最好的问候。
朱利安
【问题讨论】:
-
谢谢你们的 cmets 先生们,我会尝试安装一个 mingw 编译的 Qt 版本并让它全部工作......