使用cmake成功生成mxnet工程,但Vs2015编译时出错

安装和配置问题反馈,请提供如下信息以帮助更好地诊断问题,社区也会更乐于提供帮助。

或者手动填写下面的信息

操作系统和版本

OS: Win10
Vs2015 、mxnet1.5.1、openblas(lastest)、opencv 4.1.2、cmake 3.17

问题的记录

使用vs2015编译openblas和opencv后,使用cmake成功生成mxnet的vs2015工程,在编译时提示如下错误:
Error C2062 type ‘float’ unexpected (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 481
Error C3805 ‘type’: unexpected token, expected either ‘}’ or a ‘,’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 481
Error C2039 ‘SEQ’: is not a member of ‘cv::FileNode’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1035
Error C2065 ‘SEQ’: undeclared identifier (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1035
Error C2039 ‘FLOW’: is not a member of ‘cv::FileNode’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1035
Error C2065 ‘FLOW’: undeclared identifier (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1035
Error C2661 ‘cv::internal::WriteStructContext::WriteStructContext’: no overloaded function takes 2 arguments (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1035
Error C2039 ‘SEQ’: is not a member of ‘cv::FileNode’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1042
Error C2065 ‘SEQ’: undeclared identifier (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1042
Error C2039 ‘FLOW’: is not a member of ‘cv::FileNode’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1042
Error C2065 ‘FLOW’: undeclared identifier (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1042
Error C2661 ‘cv::internal::WriteStructContext::WriteStructContext’: no overloaded function takes 2 arguments (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1042
Error C2039 ‘SEQ’: is not a member of ‘cv::FileNode’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1055
Error C2065 ‘SEQ’: undeclared identifier (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1055
Error C2039 ‘FLOW’: is not a member of ‘cv::FileNode’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1055
Error C2065 ‘FLOW’: undeclared identifier (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1055
Error C2661 ‘cv::internal::WriteStructContext::WriteStructContext’: no overloaded function takes 2 arguments (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core\persistence.hpp 1055
Error C2062 type ‘float’ unexpected (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core.hpp 3176
Error C3805 ‘type’: unexpected token, expected either ‘}’ or a ‘,’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core.hpp 3176
Error C2589 ‘float’: illegal token on right side of ‘::’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core.hpp 3243
Error C2059 syntax error: ‘::’ (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core.hpp 3243
Error C1903 unable to recover from previous error(s); stopping compilation (compiling source file E:\DL_GIT\mxnet\mxnet\src\initialize.cc) mxnet E:\soft\opencv4\opencv\sources\modules\core\include\opencv2\core.hpp 3243
Error D8040 error creating or communicating with child process mxnet E:\DL_GIT\mxnet\build\cl 1
Error LNK1104 cannot open file ‘Debug\mxnet.lib’ im2rec E:\DL_GIT\mxnet\build\LINK 1

尝试过的解决方法

  1. 更新编译opencv

应该和opencv有关,是cmake生成opencv工程时选择哪些选项么?