提问人:MSMagona 提问时间:10/9/2023 最后编辑:jay.sfMSMagona 更新时间:10/10/2023 访问量:49
如何修复在 R 中加载“wk”包时出错?
How to fix Error loading 'wk' package in R?
问:
尝试在 R 中加载“wk”包时收到以下错误消息:
> install.packages("wk")
Retrieving 'https://cloud.r-project.org/src/contrib/wk_0.8.0.tar.gz' ...
OK [file is up to date]
Installing wk [0.8.0] ...
FAILED
Error installing package 'wk':
==============================
* installing *source* package ‘wk’ ...
** package ‘wk’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/opt/R/4.1.3/lib64/R/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c bbox-handler.c -o bbox-handler.o
bbox-handler.c: In function ‘wk_bbox_handler_realloc_result’:
bbox-handler.c:44:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 4; i ++) {
^
bbox-handler.c:44:5: note: use option -std=c99 or -std=gnu99 to compile your code
bbox-handler.c: In function ‘wk_bbox_handler_append’:
bbox-handler.c:65:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 4; i++) {
^
bbox-handler.c: In function ‘wk_c_bbox_handler_new’:
bbox-handler.c:173:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 4; i++) {
^
bbox-handler.c: In function ‘wk_envelope_handler_vector_start’:
bbox-handler.c:201:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 4; i++) {
^
bbox-handler.c: In function ‘wk_c_envelope_handler_new’:
bbox-handler.c:308:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 0; i < 4; i++) {
^
make: *** [bbox-handler.o] Error 1
ERROR: compilation failed for package ‘wk’
* removing ‘/home/mmagona/renv/staging/2/wk’
Error: install of package 'wk' failed [error code 1]
找不到有关此错误的大量信息,我需要它阻止我安装“sf”包。任何帮助表示赞赏。
我正在使用 R 版本 4.1.3
答: 暂无答案
评论
library(wk)
install.packages("wk")
/opt/R/4.1.3/
/home/mmagona/renv/staging/2/wk