error: ambiguous overload for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream

本文指导如何修复在安装Ceres Solver时遇到的‘operator<<’函数重载冲突问题,原因可能是旧版glog。通过先卸载旧glog,然后下载并安装最新v6.0版本来解决,附上详细步骤和glog下载链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装ceres-solver时产生error: ambiguous overload for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream}’ and ‘std::nullptr_t’


(*os) << v;问题?

该情况是因为下载的glog版本太老导致无法正常安装ceres-solver,可以尝试使用一个较新的glog版本。

# apt安装与卸载Glog

```
//安装
sudo apt-get install libgoogle-glog-dev
//卸载
sudo apt-get remove libgoogle-glog-dev
```
首先先卸载原始的glog
其次去glog官网下载**v6.0的glog**进行安装

官网链接: [https://github.com/google/glog/tags](https://github.com/google/glog/tags).



![glog版本](https://img-blog.csdnimg.cn/55fd7a82c78b4206a47bd9803093a1b4.png)
```
tar -zxvf glog-0.6.0.tar.gz
cd glog
mkdir build
cd build
cmake ..
make -j 24
sudo make install
```


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值