Build for Ubuntu16.04 : why protobuf not find,是未找到protobuf 吗
detail | 详细描述
依赖都已经按照要求安装。 运行编译的命令:cmake -DCMAKE_BUILD_TYPE=Release -DNCNN_VULKAN=OFF -DNCNN_BUILD_EXAMPLES=ON .. 发生如下错误。
-
Target arch: x86 64bit -- OpenCV library: /usr -- version: 2.4.9.1 -- libraries: opencv_core;opencv_highgui;opencv_imgproc -- include path: /usr/include/opencv;/usr/include CMake Warning at tools/caffe/CMakeLists.txt:2 (find_package): **Could not find a package configuration file provided by "protobuf" with any of the following names:
protobufConfig.cmake protobuf-config.cmake**
Add the installation prefix of "protobuf" to CMAKE_PREFIX_PATH or set "protobuf_DIR" to a directory containing one of the above files. If "protobuf" provides a separate development package or SDK, be sure it has been installed.
CMake Error at tools/caffe/CMakeLists.txt:18 (if): if given arguments:
"DEFINED" "PROTOBUF_VERSION" "AND" "PROTOBUF_VERSION" "VERSION_GREATER_EQUAL" "3.22"
Unknown arguments specified
-- Configuring incomplete, errors occurred!
cmake -DNCNN_BUILD_TOOLS=OFF .. 可以跳过工具编译,caffe2ncnn这些工具可以在 release 里下载编译好的二进制程序
谢谢。您提供的方法。 另外我重新手动安装了 protocolbuffers,也编译通过了。
sudo apt-get install autoconf automake libtool curl make g++ unzip
git clone -b v3.6.1 https://github.com/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
./configure
make
make check
sudo make install
sudo ldconfig
protoc --version #输出版本号成功
请关闭issue