protobuf下载链接:https://github.com/google/protobuf/archive/v3.4.0.zip
ncnn下载链接:https://github.com/Tencent/ncnn
先安装cmake
打开 windows +r 输入cmd
cmake -version
检查环境
上面这个成功安装cmake。
- cd E:\bushu\protobuf-3.4.0 cd 到你解压的路径
-
mkdir build-vs2017
-
cd build-vs2017
- cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF ../cmake
- nmake
- nmake install
别退出
cd E:\bushu\ncnn-master
mkdir -p build-vs2017
cd build-vs2017
注意自己的路径
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -DProtobuf_INCLUDE_DIR=E:\bushu\protobuf-3.4.0/build-vs2017/install/include -DProtobuf_LIBRARIES=E:\bushu\protobuf-3.4.0/build-vs2017/install/lib/libprotobuf.lib -DProtobuf_PROTOC_EXECUTABLE=E:\bushu\protobuf-3.4.0/build-vs2017/install/bin/protoc.exe ..
nmake
nmake install
完成