0
点赞
收藏
分享

微信扫一扫

【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

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

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

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")


举报

相关推荐

0 条评论