|
1Qter豆
本帖最后由 xzhyj93 于 2017-3-20 14:45 编辑
之前在linux上跑得好好的一个项目放到windows上一直报错,关键在于引入了R语言的一个包RInside的原因,但是不知道如何修正?
我试了官方的示例仍然会报错,主要错误一个是deplicate section....和undefined reference to RInside::xxxx
请问这个问题要怎么解决呢?
这是错误信息:
14:41:38: Running steps for project qtdensity...
14:41:38: Configuration unchanged, skipping qmake step.
14:41:38: Starting: "D:\Programs\Qt\Tools\mingw530_32\bin\mingw32-make.exe"
D:/Programs/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'D:/Downloads/DownloadsPrograms/build-qtdensity-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
g++ -Wl,-subsystem,windows -mthreads -o debug/qtdensity.exe debug/qtdensity.o debug/main.o debug/moc_qtdensity.o -LD:/Programs/R/R-3.3.1/bin/i386 -lR -lm -lRblas -lRlapack D:/Programs/R/R-3.3.1/library/RInside/lib/i386/libRInside.a -lmingw32 -LD:/Programs/Qt/5.7/mingw53_32/lib D:/Programs/Qt/5.7/mingw53_32/lib/libqtmaind.a -lshell32 D:/Programs/Qt/5.7/mingw53_32/lib/libQt5Cored.a -LC:/utils/my_sql/my_sql/lib -LC:/utils/postgresql/pgsql/lib D:/Programs/Qt/5.7/mingw53_32/lib/libQt5Svgd.a D:/Programs/Qt/5.7/mingw53_32/lib/libQt5Widgetsd.a D:/Programs/Qt/5.7/mingw53_32/lib/libQt5Guid.a D:/Programs/Qt/5.7/mingw53_32/lib/libQt5Cored.a
D:/Programs/R/R-3.3.1/library/RInside/lib/i386/libRInside.a(RInside.o): duplicate section `.rdata$_ZTVN4Rcpp9exceptionE[__ZTVN4Rcpp9exceptionE]' has different size
D:/Programs/R/R-3.3.1/library/RInside/lib/i386/libRInside.a(RInside.o): duplicate section `.rdata$_ZTVN4Rcpp15no_such_bindingE[__ZTVN4Rcpp15no_such_bindingE]' has different size
D:/Programs/R/R-3.3.1/library/RInside/lib/i386/libRInside.a(RInside.o): duplicate section `.rdata$_ZTVN4Rcpp17binding_is_lockedE[__ZTVN4Rcpp17binding_is_lockedE]' has different size
D:/Programs/R/R-3.3.1/library/RInside/lib/i386/libRInside.a(RInside.o): duplicate section `.rdata$_ZTVN4Rcpp10eval_errorE[__ZTVN4Rcpp10eval_errorE]' has different size
D:/Programs/R/R-3.3.1/library/RInside/lib/i386/libRInside.a(RInside.o): duplicate section `.rdata$_ZTCN4Rcpp8RostreamILb1EEE0_So[__ZTCN4Rcpp8RostreamILb1EEE0_So]' has different size
D:/Programs/R/R-3.3.1/library/RInside/lib/i386/libRInside.a(RInside.o): duplicate section `.rdata$_ZTVN4Rcpp8RostreamILb1EEE[__ZTVN4Rcpp8RostreamILb1EEE]' has different size
D:/Programs/R/R-3.3.1/library/RInside/lib/i386/libRInside.a(RInside.o): duplicate section `.rdata$_ZTCN4Rcpp8RostreamILb0EEE0_So[__ZTCN4Rcpp8RostreamILb0EEE0_So]' has different size
D:/Programs/R/R-3.3.1/library/RInside/lib/i386/libRInside.a(RInside.o): duplicate section `.rdata$_ZTVN4Rcpp8RostreamILb0EEE[__ZTVN4Rcpp8RostreamILb0EEE]' has different size
debug/qtdensity.o: In function `ZN9QtDensityC2ER7RInside':
D:\Downloads\DownloadsPrograms\build-qtdensity-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../../../qt/qtdensity.cpp:15: undefined reference to `RInside:perator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
D:\Downloads\DownloadsPrograms\build-qtdensity-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../../../qt/qtdensity.cpp:16: undefined reference to `RInside::parseEval(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
D:\Downloads\DownloadsPrograms\build-qtdensity-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../../../qt/qtdensity.cpp:17: undefined reference to `RInside::parseEval(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
debug/qtdensity.o: In function `ZN9QtDensity4plotEv':
D:\Downloads\DownloadsPrograms\build-qtdensity-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../../../qt/qtdensity.cpp:96: undefined reference to `RInside:perator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
D:\Downloads\DownloadsPrograms\build-qtdensity-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../../../qt/qtdensity.cpp:97: undefined reference to `RInside:perator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
D:\Downloads\DownloadsPrograms\build-qtdensity-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../../../qt/qtdensity.cpp:102: undefined reference to `RInside::parseEvalQ(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
debug/qtdensity.o: In function `ZN9QtDensity16runRandomDataCmdEv':
D:\Downloads\DownloadsPrograms\build-qtdensity-Desktop_Qt_5_7_0_MinGW_32bit-Debug/../../../qt/qtdensity.cpp:127: undefined reference to `RInside::parseEvalQNT(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [debug/qtdensity.exe] Error 1
mingw32-make: *** [debug] Error 2
Makefile.Debug:65: recipe for target 'debug/qtdensity.exe' failed
mingw32-make[1]: Leaving directory 'D:/Downloads/DownloadsPrograms/build-qtdensity-Desktop_Qt_5_7_0_MinGW_32bit-Debug'
Makefile:34: recipe for target 'debug' failed
14:41:40: The process "D:\Programs\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project qtdensity (kit: Desktop Qt 5.7.1 MinGW 32bit)
The kit Desktop Qt 5.7.1 MinGW 32bit has configuration issues which might be the root cause for this problem.
When executing step "Make"
14:41:40: Elapsed time: 00:01.
下面是.pro文件- ## build an app based on the one headers and two source files
- TEMPLATE = app
- HEADERS = qtdensity.h
- SOURCES = qtdensity.cpp main.cpp
- ## beyond the default configuration, also use SVG graphics
- QT += svg
- ## comment this out if you need a different version of R,
- ## and set set R_HOME accordingly as an environment variable
- R_HOME = $system(R RHOME)
- #message("R_HOME is" $R_HOME)
- ## include headers and libraries for R
- RCPPFLAGS = $system($R_HOME/bin/R CMD config --cppflags)
- RLDFLAGS = $system($R_HOME/bin/R CMD config --ldflags)
- RBLAS = $system($R_HOME/bin/R CMD config BLAS_LIBS)
- RLAPACK = $system($R_HOME/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
- ## note that RCPPLIBS will be empty with Rcpp (>= 0.11.0) and can be omitted
- RCPPINCL = $system($R_HOME/bin/Rscript -e "Rcpp:::CxxFlags\(\)")
- RCPPLIBS = $system($R_HOME/bin/Rscript -e "Rcpp:::LdFlags\(\)")
- ## for some reason when building with Qt we get this each time
- ## /usr/local/lib/R/site-library/Rcpp/include/Rcpp/module/Module_generated_ctor_signature.h:25: warning: unused parameter ‘classname
- ## so we turn unused parameter warnings off
- ## no longer needed with Rcpp 0.9.3 or later
- #RCPPWARNING = -Wno-unused-parameter
- ## include headers and libraries for RInside embedding classes
- RINSIDEINCL = $system($R_HOME/bin/Rscript -e "RInside:::CxxFlags\(\)")
- RINSIDELIBS = $system($R_HOME/bin/Rscript -e "RInside:::LdFlags\(\)")
- ## compiler etc settings used in default make rules
- QMAKE_CXXFLAGS += $RCPPWARNING $RCPPFLAGS $RCPPINCL $RINSIDEINCL
- QMAKE_LIBS += $RLDFLAGS $RBLAS $RLAPACK $RINSIDELIBS $RCPPLIBS
- ## addition clean targets
- QMAKE_CLEAN += qtdensity Makefile
复制代码
|
|