我在编译"raster“包时遇到了问题。我尝试了install.packages("raster",dependencies = TRUE),但没有成功。有什么建议吗?主要问题是:
g++ -m64 -std=gnu++0x -I/usr/include/R -DNDEBUG -I"/home/zfgbe/R/x86_64-redhat-linux-gnu-library/3.4/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RasterModule.cpp -o RasterModule.o
In file included from RasterModule.cpp:2:
spat.h:158: error: ISO C++ forbids initialization of member ‘crs’
spat.h:158: error: making ‘crs’ static
spat.h:158: error: invalid in-class initialization of static data member of non-integral type ‘std::string’
spat.h: In member function ‘std::string SpRaster::getCRS()’:
spat.h:200: error: ‘crs’ was not declared in this scope
spat.h: In member function ‘void SpRaster::setCRS(std::string)’:
spat.h:201: error: ‘crs’ was not declared in this scope
make: *** [RasterModule.o] Error 1
ERROR: compilation failed for package ‘raster’发布于 2019-03-07 17:30:03
问题是依赖于相当新的C++实现(C++11)。版本2.5-8的栅格没有此依赖关系。对我来说,这个安装命令起作用了:
install.packages("https://cran.r-project.org/src/contrib/Archive/raster/raster_2.5-8.tar.gz", repos = NULL, type="source")https://stackoverflow.com/questions/55019040
复制相似问题