0

这是一个编译问题。

该项目适用于 Linux 和 OS X,并且必须移植到 Windows。它使用 RInside 和 Rcpp 库。

为此,我安装了 R、Cygwin 和 RTools 并编译了 R 库。它工作得很好。

现在的问题:

QMake 步骤发生时没有错误,但建筑物因错误而退出。我明白了:

error: [1]: No such file or directory
error: Rcpp:::CxxFlags(): Invalid argument
error: [1]: No such file or directory
error: RInside:::CxxFlags(): Invalid argument

长版:

17:18:36: Débute : "C:\Qt\Qt5.7.0\Tools\mingw530_32\bin\mingw32-make.exe" 
C:/Qt/Qt5.7.0/5.7/mingw53_32/bin/qmake.exe -spec win32-g++ CONFIG+=debug CONFIG+=qml_debug -o Makefile ../IHM/Rpp-IHM.pro
C:/Qt/Qt5.7.0/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/Henri/Desktop/rpp/src/build-Rpp-IHM-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
g++ -c -pipe -fno-keep-inline-dllexport -Wno-unused-parameter -IC:/Progz/R-3.3.2/include -IC:/Progz/R-3.3.2/include/x64 [1] "Rcpp:::CxxFlags()" [1] "RInside:::CxxFlags()" -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../IHM -I. -I../computer/RppUtils -I../computer/RppEngine -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtSvg -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtWidgets -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtGui -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtANGLE -IC:/Qt/Qt5.7.0/5.7/mingw53_32/include/QtCore -Idebug -IC:/Qt/Qt5.7.0/5.7/mingw53_32/mkspecs/win32-g++  -o debug/WrapperRppR.o ../IHM/WrapperRppR.cpp
g++.exe: error: [1]: No such file or directory
g++.exe: error: Rcpp:::CxxFlags(): Invalid argument
g++.exe: error: [1]: No such file or directory
g++.exe: error: RInside:::CxxFlags(): Invalid argument
Makefile.Debug:2914: recipe for target 'debug/WrapperRppR.o' failed
mingw32-make[1]: *** [debug/WrapperRppR.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/Henri/Desktop/rpp/src/build-Rpp-IHM-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
17:18:40: Le processus "C:\Qt\Qt5.7.0\Tools\mingw530_32\bin\mingw32-make.exe" s'est terminé avec le code 2.
Erreur lors de la compilation/déploiement du projet Rpp-IHM (kit : Desktop Qt 5.7.0 MinGW 32bit)
When executing step "Make"

事实上,它似乎没有找到 RInside.h,尽管 R_HOM 变量设置为 R 的目录(此处为:C:/Progz/R-3.3.2/)。

这是 .pro 文件的一部分:

QT       += core gui svg

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET    = Rpp-IHM
TEMPLATE  = app
CONFIG   += c++11
CONFIG   += -v

## comment this out if you need a different version of R,
## and set set R_HOME accordingly as an environment variable
## R_HOM = $$system($$R_HOME)
win32 {
    #A specifier
    R_HOM = "C:/Progz/R-3.3.2/"
}
unix:!macx {
    # WORKING
    R_HOM = "/usr/lib/R/"
}
macx {
    # WORKING
    R_HOM =  "/Library/Frameworks/R.framework/Resources/"
}

## include headers and libraries for R
RCPPFLAGS =             $$system($$R_HOM/bin/R CMD config --cppflags)
RLDFLAGS =              $$system($$R_HOM/bin/R CMD config --ldflags)
RBLAS =                 $$system($$R_HOM/bin/R CMD config BLAS_LIBS)
RLAPACK =               $$system($$R_HOM/bin/R CMD config LAPACK_LIBS)

## if you need to set an rpath to R itself, also uncomment
RRPATH =               -Wl,-rpath,R_HOME/lib

## include headers and libraries for Rcpp interface classes
RCPPINCL =              $$system($$R_HOM/bin/Rscript -e \'Rcpp:::CxxFlags\(\)\')
RCPPLIBS =              $$system($$R_HOM/bin/Rscript -e \'Rcpp:::LdFlags\(\)\')

## for some reason when building with Qt we get this each time
## so we turn unused parameter warnings off
RCPPWARNING =           -Wno-unused-parameter
## include headers and libraries for RInside embedding classes
RINSIDEINCL =           $$system($$R_HOM/bin/Rscript -e \'RInside:::CxxFlags\(\)\')
RINSIDELIBS =           $$system($$R_HOM/bin/Rscript -e \'RInside:::LdFlags\(\)\')

INCLUDEPATH = ../computer/RppUtils
INCLUDEPATH += ../computer/RppEngine

## compiler etc settings used in default make rules
QMAKE_CXXFLAGS +=       $$RCPPWARNING $$RCPPFLAGS $$RCPPINCL $$RINSIDEINCL
QMAKE_LFLAGS +=         $$RLDFLAGS $$RBLAS $$RLAPACK $$RCPPLIBS $$RINSIDELIBS
QMAKE_CXXFLAGS_WARN_OFF += -Wunused-parameter

我错过了什么?

4

0 回答 0