[Rcpp-devel] a question about missing rcpp.h

Dirk Eddelbuettel edd at debian.org
Tue Oct 11 13:11:43 CEST 2016


On 11 October 2016 at 04:10, Xinda Yang wrote:
| I am using a Windows 7 system, R studio 0.99.467, R x64 3.3.1 and R tools 34.

But you have R installed in a path with spaces. That sometimes creates
problems, and is still recommended against in question 2.2 of the 'R on
Windows FAQ' at
https://cran.r-project.org/bin/windows/base/rw-FAQ.html#How-do-I-install-R-for-Windows_003f

Worse your include path seems to be on a network drive:
-I"//INFPWFS1014.ad.unsw.edu.au/Staff081z3271570/R/...."

As this fails for you, I would suggest a local 'on the machine'
installation.

I always put mine into c:/opt/R/R-current/ instead of c:/R/R-3.3.1, say.

| I have been trying to run sourceCpp("reglinRcpp.cpp") in my R studio and got
| the following error message. It seems clear that the issue is that the Rcpp.h
| file cannot be found. So I have tried to run set PKG_CXXFLAGS=?-I/H:/R/
| win-library/3.3/Rcpp/include? in the windows command window (see attached

You don't need to do that. As you can see R knew where Rcpp was.

And I don't see screenshots as I read email in text mode. Sorry.

Dirk

| screenshot). However, this does not solve the issue. Could anyone advise me
| what I should do? Thanks a lot in advance!
| 
|  
| 
| Kind regards
| 
| Xinda
| 
|  
| 
| c:/Rtools/mingw_64/bin/g++  -I"C:/PROGRA~1/R/R-33~1.1/include" -DNDEBUG     -I"//INFPWFS1014.ad.unsw.edu.au/Staff081z3271570/R/win-library/3.3/Rcpp/include" -I"C:/Users/z3271570/Desktop/rsrcpp"  -I"d:/Compiler/gcc-4.9.3/local330/include"  -std=c++11   -O2 -Wall  -mtune=core2 -c reglinRcpp.cpp -o reglinRcpp.o
| 
| reglinRcpp.cpp:1:18: fatal error: Rcpp.h: No such file or directory
| 
|  #include <Rcpp.h>
| 
|                   ^
| 
| compilation terminated.
| 
| make: *** [reglinRcpp.o] Error 1
| 
| Warning message:
| 
| running command 'make -f "C:/PROGRA~1/R/R-33~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_17.dll" WIN=64 TCLBIN=64 OBJECTS="reglinRcpp.o"' had status 2 
| 
| Error in sourceCpp("reglinRcpp.cpp") : 
| 
|   Error 1 occurred building shared library.
| 
|  
| 
|  
| 
|  
| 
| x[DELETED ATTACHMENT reglinRcpp.cpp, plain text]
| x[DELETED ATTACHMENT Capture.PNG, PNG image]
| _______________________________________________
| 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

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


More information about the Rcpp-devel mailing list