OPENCV建筑物由于DirectX而失败
OpenCV building fails due to DirectX
我正在遵循本指南,以在Windows 7下的QT5编译OPENCV。我正在使用:
- cmake 3.14.3
- OPENCV 4.1.0
- QT 5.12.2
我按照所述配置并设置参数。然后开始汇编。它因许多类似错误而失败:
C:opencvsourcesmodulescoresrcdirectx.cpp:1055:5: error: 'cl_context' was not declared in this scope
cl_context context = (cl_context)ctx.ptr();
^~~~~~~~~~
C:opencvsourcesmodulescoresrcdirectx.cpp:1055:5: note: suggested alternative: '_onexit'
cl_context context = (cl_context)ctx.ptr();
^~~~~~~~~~
_onexit
C:opencvsourcesmodulescoresrcdirectx.cpp:1057:5: error: 'cl_int' was not declared in this scope
cl_int status = 0;
^~~~~~
C:opencvsourcesmodulescoresrcdirectx.cpp:1057:5: note: suggested alternative: 'lrint'
cl_int status = 0;
^~~~~~
lrint
C:opencvsourcesmodulescoresrcdirectx.cpp:1058:12: error: expected ';' before 'clImage'
cl_mem clImage = 0;
^~~~~~~
C:opencvsourcesmodulescoresrcdirectx.cpp:1062:5: error: 'clImage' was not declared in this scope
clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status);
^~~~~~~
C:opencvsourcesmodulescoresrcdirectx.cpp:1062:5: note: suggested alternative: 'IplImage'
clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status);
^~~~~~~
IplImage
C:opencvsourcesmodulescoresrcdirectx.cpp:1062:44: error: 'context' was not declared in this scope
clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status);
^~~~~~~
C:opencvsourcesmodulescoresrcdirectx.cpp:1062:44: note: suggested alternative: 'onexit'
clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status);
^~~~~~~
onexit
C:opencvsourcesmodulescoresrcdirectx.cpp:1062:53: error: 'CL_MEM_WRITE_ONLY' was not declared in this scope
clImage = clCreateFromD3D11Texture2DNV(context, CL_MEM_WRITE_ONLY, pD3D11Texture2D, 0, &status);
我在CMAKE中禁用WITH_DIRECTX
标志,然后:
- 配置
- 生成
-
mingw32-make clean
-
mingw32-make -j 8
但是错误仍然存在。我还必须做什么来解决此问题?
禁用DirectX,我还必须关闭所有与OpenCL相关的项目:
- opencl_found
- opencv_dnn_opencl
- with_opencl
- 与_openclamdblas
- 使用_openclamdfft
- 使用opencl_d3d11_nv
- with_opencl_svm
了解OpenCL与DirectX有关。
相关文章:
- 如果没有malloc,链表实现将失败
- 模板参数替换失败,并且未完成隐式转换
- 具有默认模板参数的多态类的模板推导失败
- 视图中的参数推导失败:take_while
- 链接到自行创建的dll失败
- 带有特殊路径部分的"std::filesystem::weakly_canonical"失败
- GetShortPathName在网络驱动器上使用中文文件夹时失败
- gcc和c++17的过载解析失败
- 为什么使用 P/Invoke 调用 dll 时,某些计算机中的 LoadLibrary 失败?
- 在WSL:configure_file上对config_file的每次调用都失败:配置文件时出现问题
- 使用 GCC 卸载的 OpenMP 卸载失败,并出现"Ptx assembly aborted due to errors"
- 使用cmake从源代码构建MySQL连接器/C++失败(与以前的声明冲突)
- 链接阶段在Ubuntu上失败,但在MacOS上失败
- 从父数组测试用例构造二叉树失败
- LibGit2 SSH身份验证失败
- 如何让LLDB在成功时退出,在失败时等待
- DirectX 11 GetDisplayModeList() 在远程桌面连接中失败
- OPENCV建筑物由于DirectX而失败
- DirectX 11 CreateSwapChain() 失败,错误DXGI_ERROR_INVALID_CALL
- 远程桌面创建DirectX设备失败