ncnn安装教程

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,并解压然后编译。

  1.  
    cd protobuf-3.7.0
  2.  
    ./configure
  3.  
    make
  4.  
    make check
  5.  
    sudo make install
  6.  
    sudo ldconfig # refresh shared library cache

安装完成,查看版本号:

protoc --version

2.安装ncnn

  1.  
    $ git clone https://github.com/Tencent/ncnn.git
  2.  
    $ cd ncnn
  3.  
    $ cd build
  4.  
    $ cmake -DNCNN_VULKAN=OFF ..
  5.  
    $ make -j8
  6.  
    $ 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)  

原文地址:https://www.cnblogs.com/shuimuqingyang/p/13952109.html