1 | initial version |
C++/C header malloc.h has been deprecated ages ago, and should not be used. In this case the compiler causes an error if one tries it. In place of malloc.h, stdlib.h should be used, as the error message tries to tell in its clumsy way. It seems that #include <malloc.h> is found in some OpenCV files even in the latest version: - 3rdparty\include\opencl\1.2\CL\cl.hpp (1 hit) - modules\core\src\alloc.cpp (1 hit)
In the cl.hpp it is included for WIN32 compilation, but in alloc.cpp it is used if HAVE_POSIX_MEMALIGN variable is false. I would just change malloc.h to stdlib.h in alloc.cpp and see what happens - there may be some side effects, but likely not. Of course, there may be a deeper cause for the problem, which may show as other problems in building or execution.