当我在项目的构建目录中做一个cmake时,我得到了这个错误。一开始我有一个
找不到protobuf-config.cmake
错误。因此,我给出了protobuf-config.cmake文件到Protobuf_DIR的路径。之后,它开始显示这个新错误:
/opt/cmake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137上的CMake错误(消息):找不到Protobuf (丢失: Protobuf_PROTOC_EXECUTABLE) (找到合适的版本"3.6.1",最低要求为"3.0.0")
我还附加了错误日志文件:FjwLqwhCx
我在Ubuntu-18上使用cmake版本: 3.13和protobuf版本: 3.6.1来实现这一点。
发布于 2020-02-13 23:38:57
您可能没有安装Protobuf编译器和开发文件。要解决这个问题,请运行以下命令:
sudo apt-get install protobuf-compiler libprotobuf-dev或者,如果您手工构建Protobuf,则不能将其构建为RelWithDebInfo类型,因为这会导致库和CMake的问题。
发布于 2020-12-30 12:27:36
在Ubuntu20.04上安装apt,不具有对/usr/include/google的权限
修复:sudo chmod +Xr -R /usr/include/google
发布于 2020-02-19 11:49:24
默认存储库通常包含过时的protobuf版本。最好是手动安装它,从源:
git clone --progress -b v3.10.0 https://github.com/protocolbuffers/protobuf && \
( \
cd protobuf; \
mkdir build; \
cd build; \
cmake ../cmake \
-DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_BUILD_SHARED_LIBS=ON \
-Dprotobuf_BUILD_TESTS=OFF; \
make -j4 install; \
) && \
rm -rf protobufhttps://stackoverflow.com/questions/55039756
复制相似问题