Open sunqian119 opened 4 months ago
There are several options:
qt6_disable_unicode_defines
/ qt_disable_unicode_defines
in CMake for opencv_world
target. Docs: https://doc.qt.io/qt-6/qt-disable-unicode-defines.html#undef UNICODE
in the beginning of trace.cpp fileThere are several options:
- try to place
qt6_disable_unicode_defines
/qt_disable_unicode_defines
in CMake foropencv_world
target. Docs: https://doc.qt.io/qt-6/qt-disable-unicode-defines.html- try to
#undef UNICODE
in the beginning of trace.cpp file
Thanks anyway. I have added the command at this place and it worked. Maybe the only one solution is to disable the UNICODE. :sweat_smile:
There is still a problem in source code, so lets keep this issue open.
System Information
OpenCV: 4.9.0 Operating System / Platform: WIN 11 Home Compiler & compiler version: MSVC 1939 CMake version: 3.29.2
Detailed description
I choose "WITH_QT" (version 6.7.0) and "build_opencv_world" in cmake-gui, part of error logs are as follows:
D:\OPENCV\opencv-4.9.0\modules\core\src\trace.cpp(211,46): error C2664: “itt_domain (const wchar_t )”: 无法将参数 1 从“const char [12]”转换为“const wchar_t *” D:\OPENCV\opencv-4.9.0\modules\core\src\trace.cpp(211,46): 指向的类型不相关; 转换需要 reinterpret_cast、C 样式强制转换或带圆括号的函数样式强制转换 D:\OPENCV\opencv-4.9.0\modules\core\src\trace.cpp(241,61): error C2664: “itt_string_handle (const wchar_t )”: 无法将参数 1 从“const char const ”转换为“const wchar_t ” D:\OPENCV\opencv-4.9.0\modules\core\src\trace.cpp(241,61): 指向的类型不相关; 转换需要 reinterpret_cast、C 样式强制转换或带圆括号的函数样式强制转换
However, everything is fine when I only choose "build_opencv_world" or "WITH_QT". And in QT assistant, I find that "In Qt 6, the UNICODE and _UNICODE compiler definitions are set by default for targets that link against Qt modules".
Steps to reproduce
choose "WITH_QT" (version 6.7.0) and "build_opencv_world" in cmake-gui
Issue submission checklist