我的报错如下:
/usr/include/c++/9/bits/stl_algobase.h:342: undefined reference to `google::protobuf::internal::RepeatedIterator<float>::operator*() const'
/usr/bin/ld: /usr/include/c++/9/bits/stl_algobase.h:343: undefined reference to `google::protobuf::internal::RepeatedIterator<float>::operator++()'
collect2: error: ld returned 1 exit status
make: *** [Makefile:105:workspace/pro] 错误 1
我是源码编译安装的protobuf:Ubuntu安装Protobuf,指定版本_C++有手就行的博客-CSDN博客
以为是安装的问题,后面重装了一遍还是报上面的错。
发现问题出现在机器之前有人二进制安装过protobuf,所以会存在上面的问题。
将二进制protobuf卸载:
sudo apt-get remove libprotobuf-dev
over~
当然,这只是我的解决思路,希望对你有帮助!