c++ - ld 无法使用 g++ 命令找到 /lib64/libmvec.so.1
问题描述
我开始使用简单的 hello world 代码学习在 linux 上构建的 c++ 项目。
#include <iostream>
int main(){
std::cout<<"hello,world"<<std::endl;
return 0;
}
当我尝试运行命令时
g++ hello.cpp
它失败了:
/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: cannot find /usr/lib64/libmvec_nonshared.a
/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: cannot find /lib64/libmvec.so.1
但是当我尝试
gcc -lstdc++ hello.cpp
编译成功,生成可执行文件a.out。
那么 g++ 有什么问题呢?
解决方案
推荐阅读
- string - 使用索引python访问列表值
- python - 无法从频道中清除消息,discord.py
- python - 如何旋转 timeindex 的值
- swift - 从 Swift 中的 func 返回 void func
- c# - C# AutoMapper - 如果源中不存在,则在 dest 属性中设置默认值
- jquery - 如何使用 ChartJS 呈现具有多个相关数据点的折线图
- javascript - 循环一个javascript函数并将结果推送到一个数组中
- mysql - Mariadb Galera 节点将不会成功重新加入,除非它选择一个特定的节点重新加入
- java - 接口如何从实现中移除依赖关系?
- kubernetes - Kubernetes (k3s):集群上的过期证书