https://blog.csdn.net/u012505617/article/details/88581235
下载protobuf并安装,我使用的是3.7最新版本,下载地址为:https://github.com/protocolbuffers/protobuf/releases/tag/v3.7.0
再下载这个protobuf-all-3.7.0.tar.gz,并解压然后编译。
-
cd protobuf-3.7.0
-
./configure
-
make
-
make check
-
sudo make install
-
sudo ldconfig # refresh shared library cache
安装完成,查看版本号:
protoc --version
2.安装ncnn
-
$ git clone https://github.com/Tencent/ncnn.git
-
$ cd ncnn
-
$ cd build
-
$ cmake -DNCNN_VULKAN=OFF ..
-
$ make -j8
-
$ make install
这样在ncnn/build/install/ 就会生成include lib 文件夹。里面包含自己所需的头文件和ncnn 库文件。
如果出现错误:/usr/bin/ld: cannot find -lncnn
那么解决方法是编译好ncnn然后在cmakelist中库连接中加如路径:
set(ZQCNN_LIBRARY_DIR
${CMAKE_CURRENT_LIST_DIR}/3rdparty/lib
${CMAKE_CURRENT_LIST_DIR}/ncnn/build/install/lib)