当前位置:   article > 正文

【ncnn】——windows下编译自拓展的后端_ncnn windows

ncnn windows

ncnn
参考:Build for Windows x64 using Visual Studio Community 2017

需要安装vs 2017/2019,然后在开始菜单中Start → Programs → Visual Studio 2017 → Visual Studio Tools → x64 Native Tools Command Prompt for VS 2017

可以不用编译tools, examples,根据自己的需求配置。

cd <protobuf-root-dir>
mkdir build
cd build
cmake -A x64 -DCMAKE_INSTALL_PREFIX=%cd%/install -DNCNN_BUILD_TOOLS=OFF ..
cmake --build . --config Release -j 2
cmake --build . --config Release --target install
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

执行完cmake -A x64 -DCMAKE_INSTALL_PREFIX=%cd%/install -DNCNN_BUILD_TOOLS=OFF .. 命令后,在 build 文件夹下生成一个ncnn.sln的 vs 项目。可以用 vs studio 打开,进行编译,测试。
在这里插入图片描述

cmake 中设置vs 的 /MTd

cmakelists.txt 中添加如下:

set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
  • 1
  • 2
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/298089
推荐阅读
相关标签
  

闽ICP备14008679号