我正在尝试在FreeBSD计算机上安装feather
软件包,由于以下错误导致崩溃:error: 'snprintf' was not declared in this scope
。 g++
用于编译。
非常感谢任何关于如何处理这个问题的提示。
以下是完整的安装日志。
* installing *source* package ‘feather’ ...
** package ‘feather’ successfully unpacked and MD5 sums checked
Platform is little endian. Good.
** libs
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c RcppExports.cpp -o RcppExports.o
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c feather-read.cpp -o feather-read.o
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c feather-types.cpp -o feather-types.o
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c feather-write.cpp -o feather-write.o
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c feather/buffer.cc -o feather/buffer.o
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c feather/feather-c.cc -o feather/feather-c.o
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c feather/io.cc -o feather/io.o
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c feather/metadata.cc -o feather/metadata.o
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c feather/reader.cc -o feather/reader.o
g++5 -std=gnu++11 -I/usr/local/lib/R/include -DNDEBUG -I. -I"/usr/local/lib/R/library/Rcpp/include" -DLIBICONV_PLUG -I/usr/local/include -isystem /usr/local/include -fpic -O2 -pipe -DLIBICONV_PLUG -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -fno-strict-aliasing -DLIBICONV_PLUG -Wl,-rpath=/usr/local/lib/gcc5 -isystem /usr/local/include -c feather/status.cc -o feather/status.o
feather/status.cc: In member function 'std::__cxx11::string feather::Status::ToString() const':
feather/status.cc:52:52: error: 'snprintf' was not declared in this scope
snprintf(buf, sizeof(buf), " (error %d)", posix);
^
gmake: *** [/usr/local/lib/R/etc/Makeconf:164: feather/status.o] Error 1
ERROR: compilation failed for package ‘feather’
* removing ‘/usr/local/lib/R/library/feather’
The downloaded source packages are in
‘/tmp/Rtmp26mAsU/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("feather") :
installation of package ‘feather’ had non-zero exit status
答案 0 :(得分:1)
问题似乎在文件feather/status.cc
中。尝试打开它并将#include <cstdio>
行添加到其顶部的包含列表。