Errors installing open CV

asked 2019-04-13 18:15:48 -0600

jaredl gravatar image

I was following these steps to use OpenCV in qt:

https://wiki.qt.io/How_to_setup_Qt_an...

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 ... (more)

edit retag flag offensive close merge delete

Comments

you probably should not look at a qt wiki, when the problem is "how to install opencv" ?

do you absolutely need qt here ? (you have to build that using mingw, which has a lot of problems / no support from opencv)

berak gravatar imageberak ( 2019-04-14 09:44:17 -0600 )edit
1

Well I want to use open CV libraries inside of the qt creator, which is why I was following this wiki. If I build it with something else can I still accomplish this?

jaredl gravatar imagejaredl ( 2019-04-14 10:28:50 -0600 )edit

well, i tried with mingw 7.2.0 and i had to disable directx support:

cmake -DWITH_DIRECTX=OFF

(it seems, mingw has only proper support up to dx9)

berak gravatar imageberak ( 2019-04-14 10:54:15 -0600 )edit

How can I do this with the cmke GUI?

jaredl gravatar imagejaredl ( 2019-04-19 12:09:27 -0600 )edit

I was able to propperly compile OpenCV 3.1 with MinGW. With newer versions I am obtaining this error

Freeman gravatar imageFreeman ( 2019-04-22 13:10:11 -0600 )edit