ошибка компиляции для пакета "растр" - PullRequest
0 голосов
/ 06 марта 2019

У меня проблемы с компиляцией "растрового" пакета.Я попытался установить .packages ("растр", зависимости = 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’

1 Ответ

1 голос
/ 07 марта 2019

Проблема заключается в зависимости от довольно новой реализации 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")
...