-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nmake sometimes may fail saying "name return code 0x2" #2498
Comments
经过排查,该群友发现是cmake命令多写了一个 |
P.S. 指定 具体说,cmake时用的是: cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install ^
-DProtobuf_INCLUDE_DIR=../../protobuf-3.4.0/build-vs2019/install/include ^
-DProtobuf_LIBRARIES=../../protobuf-3.4.0/build-vs2019/install/lib/libprotobuf.lib ^
-DProtobuf_PROTOC_EXECUTABLE=../../protobuf-3.4.0/build-vs2019/install/bin/protoc.exe ^
-DNCNN_VULKAN=OFF ^
-DOpenCV_DIR=E:/lib/opencv/4.5.0 .. 报错类似: 需要把 Protobuf_LIBRARIES 等变量,换成绝对路径,来解决问题 |
@zchrissirhcz vs2019 编译 opencv4.5.0 不成功 "../.." CMake Error: The source directory "E:/dbg/cnn-deploy" does not appear to contain CMakeLists.txt. |
在群里讨论,vs2019,nmake方式,编译ncnn的最后有报错:
本人按照 ncnn wiki(也即是doc目录下的 how-to-build/build-for-VS2017.zh.md)方式实践了下,可以成功编译,这里贴一下过程:
软件准备
vs2019,用的是16.8.2版本。通常小版本的差异不影响编译。
cmake,用的是3.19.1,通常来说>=3.15就没问题的。
开始编译
在开始菜单选择vs2019 x64 native的cmd窗口
下载了 protobuf 3.4.0 的源码:https://github.com/google/protobuf/archive/v3.4.0.zip
创建了 E:\dbg\cnn-deploy 目录,把protobuf-3.4.0.zip放过去了,等下ncnn源码也放在这个目录下
接下来就是命令行操作了:
这里相对于原始 ncnn wik 里的做法,我的修改:
OpenCV_DIR
变量,这个变量指向包含 OpenCVConfig.cmake 的目录。额外:vs2019编译opencv
对于VS2019来说,OpenCV官方没给VS2019的预编译版本,我是自行编译的。编译过程用命令行的方式来记录,是这样的:
The text was updated successfully, but these errors were encountered: