cpp-package: Cannot open include file: 'mxnet-cpp/op.h'
I synced latest code and tried to build mxnet . Build fails with the following error message.
cpp-package\include\mxnet-cpp/optimizer.hpp(19): fatal error C1083: Cannot open include file: 'mxnet-cpp/op.h': No such file or directory
It seems 00b2b47f70283e0706256b8585b97b63efd25c57 change set removed mxnet-cpp/op.h. but other code is still including "mxnet-cpp/op.h"
MxNetCpp.h optimizer.hpp .cpp files under cpp-package/example/ these file include "mxnet-cpp/op.h".
Environment info
Operating System:Windows 10
Compiler: Visual Studio 2013
Package used (Python/R/Scala/Julia):Cpp-package
MXNet commit hash (git rev-parse HEAD):3f75c41fb3cd176089bfd06ab76a0e04723cefe0
Error Message:
10>D:\nvTFS2\External\Mxnet\mxnet_20170517_3f75c41fb3cd176089bfd06ab76a0e04723cefe0\cpp-package\include\mxnet-cpp/optimizer.hpp(19): fatal error C1083: Cannot open include file: 'mxnet-cpp/op.h': No such file or directory
Minimum reproducible example
#include "MxNetCpp.h"
Did you try to set USE_CPP_PACKAGE=1 and make -j from ~/mxnet?
How did you create the project in vs?
I use cmake to make vs project.

What's the output when building in visual studio. Could you searchRunning OpWrapperGenerator.py in the output window?
I see . Does OpWrapperGeneratoer.py generate op.h?
I miss this error.
9> "Running: OpWrapperGenerator.py"
9> Traceback (most recent call last):
9> File "OpWrapperGenerator.py", line 402, in
Which python package do I need to install? I could not find setupenv.cmd which is mentioned at http://mxnet.io/get_started/windows_setup.html.
Could you edit this line https://github.com/dmlc/mxnet/blob/master/cpp-package/CMakeLists.txt#L14
to
COMMAND echo "Running: OpWrapperGenerator.py $<TARGET_FILE:mxnet>"
then regenerate the solution and paste the output here?
i know what's happening. some dependencies (probably blas or opencv) are missing. you need to register the dlls systemwide.
Built is succeeded after I edited CmakeList.txt and added blas path. Thank you.
Got error below building mxnet in windows!

Environment info
Operating System:Windows 7 Compiler: Visual Studio 2013 x64 Package used (Python/R/Scala/Julia):Cpp-package
Build Options

i meet the same problem but my error tip is
7>"Running: OpWrapperGenerator.py E:/MxNet/incubator-mxnet/build/Debug/libmxnet.dll"
7>Traceback (most recent call last):
7> File "OpWrapperGenerator.py", line 426, in
@Rangocold Do you have openblas dll registered?
Alright. I have the same problem than explained here. But I would be interested to know how @rococopeach managed to solve the problem! Because I have no idea why openblas can't be found, and if it is really openblas that is the problem...
@dmidge8 i give up openblas because i config the environment many days but not work i use mkl final, it works when u cmake , add an item ENABLE_MODULE_MKL is key if u want to use openblas, i find a video may help u https://www.bilibili.com/video/av18047152/
@Rangocold Thank you for your help! Unfortunately, I still didn't manage to make it work. Except the fact that I didn't include OpenCV during the Cmake (there is the USE_OPENCV that you can turn off if you want to avoid using it). And I confirm, openblas is hard to properly use, it seems... If MKL is the Intel Math Kernel Library, I would rather not use it. But it seems the problem comes from the header file that is not generated, because the python script get stucks with OSError: [WinError 126]. The problem is during the cdll.LoadLibrary. Would it be possible to generate the header file another way?
@dmidge8 You have to use some linear algebra library (openblas, MKL or something equivalent) to make it work, because if the header generator can't read the API information from the mxnet dll, it means other programs that depend on mxnet.dll won't work either.
@lx75249 Indeed. But I have Openblas in my path, which is also configured in cmake, and I even tried to put openblas directly in the build\Debug\libmxnet.dll folder, altogether with other possibly missing dlls...
Alright, I get it a bit better. Openblas requires some MinGW library to have all its dependencies satisfied. I had to download them and make them available in the path to have them working.
Had the same problem, "Cannot open include file: 'mxnet-cpp/op.h". I fixed it by edit output_file_name = "cpp-package/include/mxnet-cpp/op.h", in OpWrapperGenerator.py file.
Hi, I got the same problem when generating op.h: Windows 10, Mxnet 1.4, MVSC 14, CMake3.10, Cuda9.0 set USE_CPP_PACKAGE=1 BLAS = MKL (installed version from Intel site) Opencv3.42
I ran D:\Paul\libs_sources\mxnet14\cpp-package\scripts>python OpWrapperGenerator.py d:/Paul/libs_sources/mxnet14/build/Release/libmxnet.dll
and got an error:
kernel32 0
dll name to load d:/Paul/libs_sources/mxnet14/build/Release/libmxnet.dll
d:/Paul/libs_sources/mxnet14/build/Release/libmxnet.dll 0
Traceback (most recent call last):
File "OpWrapperGenerator.py", line 432, in <module>
raise(e)
File "OpWrapperGenerator.py", line 426, in <module>
f.write(patternStr % ParseAllOps())
File "OpWrapperGenerator.py", line 319, in ParseAllOps
cdll.libmxnet = cdll.LoadLibrary(sys.argv[1])
File "C:\Users\dev_admin\AppData\Local\Continuum\anaconda3\envs\Mxnet131GPUPy36\lib\ctypes\__init__.py", line 428, in LoadLibrary
return self._dlltype(name)
File "C:\Users\dev_admin\AppData\Local\Continuum\anaconda3\envs\Mxnet131GPUPy36\lib\ctypes\__init__.py", line 349, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
Do you know how to generate correctly op.h? help please!
You need to put every dependency dll of mxnet.dll in your windows path (and restart visual studio to be sure that the change is applied).