Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling 4.1.0 source code with mingw-w64: 'D3D11_TEXTURE2D_DESC' was not declared in this scope #14286

Closed
huihut opened this issue Apr 9, 2019 · 5 comments

Comments

@huihut
Copy link
Contributor

huihut commented Apr 9, 2019

System information (version)
  • OpenCV => 4.1.0
  • Operating System / Platform => Windows 10 64bit
  • Compiler => mingw-w64 8.1.0-posix-seh-rt_v6-rev0
Detailed description

When I compiled the 4.1.0 version with mingw-w64, there was an error

E:\opencv-4.1.0\opencv-4.1.0\modules\core\src\directx.cpp:1035:5: error: 'D3D11_TEXTURE2D_DESC' was not declared in this scope
     D3D11_TEXTURE2D_DESC desc = { 0 };
     ^~~~~~~~~~~~~~~~~~~~

I can solve it like this

cmake -DWITH_OPENCL_D3D11_NV=OFF

But I don't know if this is the right solution, and whether this will affect the compiled dll.

@Mainvooid
Copy link
Contributor

D3D11_TEXTURE2D_DESC is declared in d3d11.h. If you don't need interoperability between D3D11 and OpenCL, you can turn off compile options, as you did.

@alalek
Copy link
Member

alalek commented Apr 9, 2019

Need to ensure that HAVE_OPENCL_D3D11_NV become disabled if HAVE_DIRECTX=OFF.

Main problem here is that DirectX checks are performed after OpenCL checks.

@huihut
Copy link
Contributor Author

huihut commented Apr 10, 2019

OK, I configured

  • WITH_OPENCL=ON
  • WITH_OPENCL_D3D11_NV=OFF
  • WITH_DIRECTX=ON

It can be successfully compiled.

If there is no problem, I close this issue.

@alalek
Copy link
Member

alalek commented Apr 10, 2019

@huihut Could you check this patch: #14294 ? (with default CMake parameters)

@huihut
Copy link
Contributor Author

huihut commented Apr 11, 2019

@alalek Well, this can be successfully compiled without modifying the default WITH_OPENCL_D3D11_NV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants