gpt4 book ai didi

c++ - R: 安装feather包时编译报错 "ISO C++ forbids in-class initialization of non-const static member"

转载 作者:行者123 更新时间:2023-11-30 03:18:48 29 4
gpt4 key购买 nike

我正在使用 R 版本 3.1.2 并想在 RStudio 中安装“feather”包:

install.packages("feather", type="source")

使用源码版本,因为好像没有二进制版本。
它确实提取文件并正确检查 MD5 和,但会在几个子步骤中抛出错误:

error: ISO C++ forbids in-class initialization of non-const static member 'xy'

以下是 RStudio 告诉我的内容的摘录:

from c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/algorithm:63,
from ./feather/buffer.h:18,
from ./feather/metadata.h:23,
from ./feather/reader.h:21,
from feather/feather-c.cc:21:
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:196:57: error: ISO C++ forbids in-class initialization of non-const static member 'is_specialized'
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:201:48: error: ISO C++ forbids in-class initialization of non-const static member 'digits'
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:204:50: error: ISO C++ forbids in-class initialization of non-const static member 'digits10'
...(for many other parts)...
(also for some:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:1587:58: note: 'bool std::numeric_limits::has_quiet_NaN' is not const
(and:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/limits:1607:51: error: the value of 'std::numeric_limits::has_infinity' is not usable in a constant expression
(then some:)
c:\users...\r\win-library\3.1\rtools\gcc-4.6.3\bin../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/bits/random.tcc:345:7: error: '_M_x' was not declared in this scope
(and finally:)
confused by earlier errors, bailing out
make: *** [feather/feather-c.o] Error 1
Warnung: Ausführung von Kommando 'make -f "Makevars" -f "C:/PROGRA~1/R/R-31~1.2/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.2/share/make/winshlib.mk" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="feather.dll" OBJECTS="RcppExports.o feather-read.o feather-types.o feather-write.o"' ergab Status 2
ERROR: compilation failed for package 'feather'
* removing 'C:/Users/.../R/win-library/3.1/feather'
* restoring previous 'C:/Users/.../R/win-library/3.1/feather'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-31~1.2/bin/x64/R" CMD INSTALL -l "C:\Users...\R\win-library\3.1" C:\Users...\AppData\LocalTemp\RtmpKsxa73/downloaded_packages/feather_0.3.2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘feather’ had non-zero exit status

我想通过 CRAN 安装 feather-package。它在 RStudio 中不起作用,在 R 控制台中也不起作用。在 Windows 8.1 上运行。

有人知道为什么无法安装吗?

对我来说问题出在包裹的某个地方?
或者可能是授权问题(我没有我的用户的管理权限,但我可以在 C:\Users\my_user 中安装任何东西)

最佳答案

此特定语言功能是 first supported in GCC 4.7 .你有 GCC 4.6.3。

您需要安装更新的 GCC 或 Clang。如果我正确阅读了错误消息,那么您的 GCC 是从 RTools 3.1 获得的。看着 project page for Rtools , Rtools 3.3 及更高版本默认为 GCC 4.9 及更高版本,它应该支持你的 feather 扩展所使用的代码。

关于c++ - R: 安装feather包时编译报错 "ISO C++ forbids in-class initialization of non-const static member",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54363300/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com