Skip to content

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

Closed

Description

@huihut
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.

Activity

  1. Mainvooid commented on Apr 9, 2019

    @Mainvooid

    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.

  2. alalek commented on Apr 9, 2019

    @alalek
    Member

    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.

  3. huihut commented on Apr 10, 2019

    @huihut
    ContributorAuthor

    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.

  4. alalek commented on Apr 10, 2019

    @alalek
    Member

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

  5. huihut commented on Apr 11, 2019

    @huihut
    ContributorAuthor

    @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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions