Ask Your Question

Revision history [back]

Errors installing open CV

I was following these steps to use OpenCV in qt:

https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows

However, when I enter mingw32-make -j 8 or mingw32-make install I get the following:

C:\opencv\sources\modules\core\src\directx.cpp: In function 'void cv::directx::__convertToD3D11Texture2DNV(cv::InputArray, ID3D11Texture2D)': C:\opencv\sources\modules\core\src\directx.cpp:1035:5: error: 'D3D11_TEXTURE2D_DESC' was not declared in this scope D3D11_TEXTURE2D_DESC desc = { 0 }; ^~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1036:20: error: invalid use of incomplete type 'struct ID3D11Texture2D' pD3D11Texture2D->GetDesc(&desc); ^~ In file included from C:\opencv\sources\modules\core\src\directx.cpp:46:0: C:/opencv/sources/modules/core/include/opencv2/core/directx.hpp:50:8: note: forward declaration of 'struct ID3D11Texture2D' struct ID3D11Texture2D; ^~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1036:22: error: invalid use of incomplete type 'struct ID3D11Texture2D' pD3D11Texture2D->GetDesc(&desc); ^~~~~~~ In file included from C:\opencv\sources\modules\core\src\directx.cpp:46:0: C:/opencv/sources/modules/core/include/opencv2/core/directx.hpp:50:8: note: forward declaration of 'struct ID3D11Texture2D' struct ID3D11Texture2D; ^~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1036:31: error: 'desc' was not declared in this scope pD3D11Texture2D->GetDesc(&desc); ^~~~ C:\opencv\sources\modules\core\src\directx.cpp:1036:31: note: suggested alternative: 'Vec' pD3D11Texture2D->GetDesc(&desc); ^~~~ Vec C:\opencv\sources\modules\core\src\directx.cpp:1051:5: error: 'cl_mem' was not declared in this scope cl_mem clBuffer = (cl_mem)u.handle(ACCESS_READ); ^~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1051:5: note: suggested alternative: 'ctime' cl_mem clBuffer = (cl_mem)u.handle(ACCESS_READ); ^~~~~~ ctime C:\opencv\sources\modules\core\src\directx.cpp:1055:5: error: 'cl_context' was not declared in this scope cl_context context = (cl_context)ctx.ptr(); ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1055:5: note: suggested alternative: '_onexit' cl_context context = (cl_context)ctx.ptr(); ^~~~~~~~~~ _onexit C:\opencv\sources\modules\core\src\directx.cpp:1057:5: error: 'cl_int' was not declared in this scope cl_int status = 0; ^~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1057:5: note: suggested alternative: 'lrint' cl_int status = 0; ^~~~~~ lrint C:\opencv\sources\modules\core\src\directx.cpp:1058:12: error: expected ';' before 'clImage' cl_mem clImage = 0; ^~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1062:5: error: 'clImage' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1062:5: note: suggested alternative: 'IplImage' clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~ IplImage C:\opencv\sources\modules\core\src\directx.cpp:1062:44: error: 'context' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1062:44: note: suggested alternative: 'onexit' clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~ onexit C:\opencv\sources\modules\core\src\directx.cpp:1062:53: error: 'CL_MEM_WRITE_ONLY' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1062:93: error: 'status' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1062:93: note: suggested alternative: 'stat' clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~ stat C:\opencv\sources\modules\core\src\directx.cpp:1062:15: error: 'clCreateFromD3D11Texture2DNV' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1062:15: note: suggested alternative: 'convertFromD3D11Texture2D' clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ convertFromD3D11Texture2D C:\opencv\sources\modules\core\src\directx.cpp:1063:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1063:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1074:5: error: 'cl_command_queue' was not declared in this scope cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr(); ^~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1075:45: error: 'q' was not declared in this scope status = clEnqueueAcquireD3D11ObjectsNV(q, 1, &clImage, 0, NULL, NULL); ^ C:\opencv\sources\modules\core\src\directx.cpp:1075:14: error: 'clEnqueueAcquireD3D11ObjectsNV' was not declared in this scope status = clEnqueueAcquireD3D11ObjectsNV(q, 1, &clImage, 0, NULL, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1076:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1076:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1100:48: error: 'clBuffer' was not declared in this scope status = clEnqueueCopyBufferToImage(q, clBuffer, clImage, offset, origin, region, 0, NULL, NULL); ^~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1100:48: note: suggested alternative: 'AutoBuffer' status = clEnqueueCopyBufferToImage(q, clBuffer, clImage, offset, origin, region, 0, NULL, NULL); ^~~~~~~~ AutoBuffer C:\opencv\sources\modules\core\src\directx.cpp:1100:18: error: 'clEnqueueCopyBufferToImage' was not declared in this scope status = clEnqueueCopyBufferToImage(q, clBuffer, clImage, offset, origin, region, 0, NULL, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1101:23: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1101:23: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1105:14: error: 'clEnqueueReleaseD3D11ObjectsNV' was not declared in this scope status = clEnqueueReleaseD3D11ObjectsNV(q, 1, &clImage, 0, NULL, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1106:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1106:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1109:14: error: 'clFinish' was not declared in this scope status = clFinish(q); // TODO Use events ^~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1110:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1110:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1113:14: error: 'clReleaseMemObject' was not declared in this scope status = clReleaseMemObject(clImage); // TODO RAII ^~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1113:14: note: suggested alternative: 'cvReleaseMemStorage' status = clReleaseMemObject(clImage); // TODO RAII ^~~~~~~~~~~~~~~~~~ cvReleaseMemStorage C:\opencv\sources\modules\core\src\directx.cpp:1114:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1114:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1054:14: warning: unused variable 'ctx' [-Wunused-variable] Context& ctx = Context::getDefault(); ^~~ C:\opencv\sources\modules\core\src\directx.cpp: In function 'void cv::directx::__convertFromD3D11Texture2DNV(ID3D11Texture2D, cv::OutputArray)': C:\opencv\sources\modules\core\src\directx.cpp:1226:5: error: 'D3D11_TEXTURE2D_DESC' was not declared in this scope D3D11_TEXTURE2D_DESC desc = { 0 }; ^~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1227:20: error: invalid use of incomplete type 'struct ID3D11Texture2D' pD3D11Texture2D->GetDesc(&desc); ^~ In file included from C:\opencv\sources\modules\core\src\directx.cpp:46:0: C:/opencv/sources/modules/core/include/opencv2/core/directx.hpp:50:8: note: forward declaration of 'struct ID3D11Texture2D' struct ID3D11Texture2D; ^~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1227:22: error: invalid use of incomplete type 'struct ID3D11Texture2D' pD3D11Texture2D->GetDesc(&desc); ^~~~~~~ In file included from C:\opencv\sources\modules\core\src\directx.cpp:46:0: C:/opencv/sources/modules/core/include/opencv2/core/directx.hpp:50:8: note: forward declaration of 'struct ID3D11Texture2D' struct ID3D11Texture2D; ^~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1227:31: error: 'desc' was not declared in this scope pD3D11Texture2D->GetDesc(&desc); ^~~~ C:\opencv\sources\modules\core\src\directx.cpp:1227:31: note: suggested alternative: 'dst' pD3D11Texture2D->GetDesc(&desc); ^~~~ dst C:\opencv\sources\modules\core\src\directx.cpp:1240:5: error: 'cl_mem' was not declared in this scope cl_mem clBuffer = (cl_mem)u.handle(ACCESS_READ); ^~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1240:5: note: suggested alternative: 'ctime' cl_mem clBuffer = (cl_mem)u.handle(ACCESS_READ); ^~~~~~ ctime C:\opencv\sources\modules\core\src\directx.cpp:1244:5: error: 'cl_context' was not declared in this scope cl_context context = (cl_context)ctx.ptr(); ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1244:5: note: suggested alternative: '_onexit' cl_context context = (cl_context)ctx.ptr(); ^~~~~~~~~~ _onexit C:\opencv\sources\modules\core\src\directx.cpp:1246:5: error: 'cl_int' was not declared in this scope cl_int status = 0; ^~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1246:5: note: suggested alternative: 'lrint' cl_int status = 0; ^~~~~~ lrint C:\opencv\sources\modules\core\src\directx.cpp:1247:12: error: expected ';' before 'clImage' cl_mem clImage = 0; ^~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1249:5: error: 'clImage' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_READ_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1249:5: note: suggested alternative: 'IplImage' clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_READ_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~ IplImage C:\opencv\sources\modules\core\src\directx.cpp:1249:44: error: 'context' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_READ_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1249:44: note: suggested alternative: 'onexit' clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_READ_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~ onexit C:\opencv\sources\modules\core\src\directx.cpp:1249:53: error: 'CL_MEM_READ_ONLY' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_READ_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1249:92: error: 'status' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_READ_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1249:92: note: suggested alternative: 'stat' clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_READ_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~ stat C:\opencv\sources\modules\core\src\directx.cpp:1249:15: error: 'clCreateFromD3D11Texture2DNV' was not declared in this scope clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_READ_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1249:15: note: suggested alternative: '__convertFromD3D11Texture2DNV' clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_READ_ONLY, pD3D11Texture2D, 0, &status); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ __convertFromD3D11Texture2DNV C:\opencv\sources\modules\core\src\directx.cpp:1250:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1250:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1263:5: error: 'cl_command_queue' was not declared in this scope cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr(); ^~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1264:45: error: 'q' was not declared in this scope status = clEnqueueAcquireD3D11ObjectsNV(q, 1, &clImage, 0, NULL, NULL); ^ C:\opencv\sources\modules\core\src\directx.cpp:1264:14: error: 'clEnqueueAcquireD3D11ObjectsNV' was not declared in this scope status = clEnqueueAcquireD3D11ObjectsNV(q, 1, &clImage, 0, NULL, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1265:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1265:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1289:57: error: 'clBuffer' was not declared in this scope status = clEnqueueCopyImageToBuffer(q, clImage, clBuffer, origin, region, offset, 0, NULL, NULL); ^~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1289:57: note: suggested alternative: 'AutoBuffer' status = clEnqueueCopyImageToBuffer(q, clImage, clBuffer, origin, region, offset, 0, NULL, NULL); ^~~~~~~~ AutoBuffer C:\opencv\sources\modules\core\src\directx.cpp:1289:18: error: 'clEnqueueCopyImageToBuffer' was not declared in this scope status = clEnqueueCopyImageToBuffer(q, clImage, clBuffer, origin, region, offset, 0, NULL, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1290:23: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1290:23: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1294:14: error: 'clEnqueueReleaseD3D11ObjectsNV' was not declared in this scope status = clEnqueueReleaseD3D11ObjectsNV(q, 1, &clImage, 0, NULL, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1295:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1295:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1298:14: error: 'clFinish' was not declared in this scope status = clFinish(q); // TODO Use events ^~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1299:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1299:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1302:14: error: 'clReleaseMemObject' was not declared in this scope status = clReleaseMemObject(clImage); // TODO RAII ^~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1302:14: note: suggested alternative: 'cvReleaseMemStorage' status = clReleaseMemObject(clImage); // TODO RAII ^~~~~~~~~~~~~~~~~~ cvReleaseMemStorage C:\opencv\sources\modules\core\src\directx.cpp:1303:19: error: 'CL_SUCCESS' was not declared in this scope if (status != CL_SUCCESS) ^~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1303:19: note: suggested alternative: 'EXIT_SUCCESS' if (status != CL_SUCCESS) ^~~~~~~~~~ EXIT_SUCCESS C:\opencv\sources\modules\core\src\directx.cpp:1243:14: warning: unused variable 'ctx' [-Wunused-variable] Context& ctx = Context::getDefault(); ^~~ C:\opencv\sources\modules\core\src\directx.cpp: At global scope: C:\opencv\sources\modules\core\src\directx.cpp:1224:13: warning: 'void cv::directx::__convertFromD3D11Texture2DNV(ID3D11Texture2D, cv::OutputArray)' defined but not used [-Wunused-function] static void __convertFromD3D11Texture2DNV(ID3D11Texture2D pD3D11Texture2D, OutputArray dst) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\opencv\sources\modules\core\src\directx.cpp:1033:13: warning: 'void cv::directx::__convertToD3D11Texture2DNV(cv::InputArray, ID3D11Texture2D)' defined but not used [-Wunused-function] static void __convertToD3D11Texture2DNV(InputArray src, ID3D11Texture2D pD3D11Texture2D) ^~~~~~~~~~~~~~~~~~~~~~~~~~~

mingw32-make[2]: * [modules\core\CMakeFiles\opencv_core.dir\build.make:384: modules/core/CMakeFiles/opencv_core.dir/src/directx.cpp.obj] Error 1 mingw32-make[1]: [CMakeFiles\Makefile2:1421: modules/core/CMakeFiles/opencv_core.dir/all] Error 2 mingw32-make: ** [Makefile:162: all] Error 2

I am new to open CV and I have no idea what to do about these errors