【发布时间】:2015-08-20 13:51:15
【问题描述】:
编译 CPP 旧版驱动程序时出现C++ compiler works....no 错误。
我正在编译:
scons --64 --cxx=/usr/local/bin/gcc -cc=/usr/local/bin/gcc --prefix=/opt/mongo install
config.log 声明:
libmpc.so.2 cannot open shared object file
libmpc.so.2 does exists in /usr/local/lib which is in LD_LIBRARY_PATH
当我为 conftest_o.cpp 文件执行编译命令时,从 config.log 编译它没有问题。
~/.bashrc and ~/.bash_profile seems fine.
操作系统:RedHat 6.6 64 位
GCC:4.9.2
mongodb CPP 旧版驱动版本:1.0.5
提升:1.57
Python:2.6.6
scons:2.3.6
感谢您的帮助。
【问题讨论】:
-
file libmpc.so.2说什么?可以手动运行编译器,还是只在configure下失败? -
你应该使用
yum安装一个C++编译器 -
libmpc.so.2 是指向不存在的文件的符号链接吗?
-
你使用 gcc 而不是 g++ 作为 C++ 编译器有什么原因吗?
-
libmpc 指向一个确实存在的文件。已安装 C++ 编译器。 Scons 运行它自己的配置,它通过编译检查编译是否有效: int main() { return 0;代码在 conftest_0.cpp config.log 中指出 /usr/local/libexec/gcc/x86_64-redhat-linux/4.9.2/cc1plus: error while loading shared libraries : libmpc.so.2 cannot open shared object文件:没有这样的文件或目录。当我从日志中复制编译命令并手动执行时,它编译没有问题。