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)