There was a strange error during compilation when including the Windows API header file before 'ui_mainwindow.h'.
-
Please provide a minimal, compilable example of your problem. I would guess you use a variable name which is also a
define
in the windows headers. Nothing Qt can do about it - use another name when you found out which one is causing the problem. -
Please provide a minimal, compilable example of your problem. I would guess you use a variable name which is also a
define
in the windows headers. Nothing Qt can do about it - use another name when you found out which one is causing the problem.The reason has been identified, setting PushButton Icon to 'DocumentProperties' will trigger this issue.
-
The reason has been identified, setting PushButton Icon to 'DocumentProperties' will trigger this issue.
@dfger
dwrite.h
must be an MSVC header file, including definitions for its ownDocumentProperties
and it will have a line like#define DocumentProperties DocumentPropertiesW
which MSVC uses for the "wide character" version. Meanwhile you are trying to use some Qt-defined symbol of
DocumentProperties
for the theme. And these clash.Try one of the following:
-
Move the
#include <dwrite.h>
line to after the#include ui_mainwindow.h
. That may, or may not, be enough to make it work. -
If you do not need the MSVC
DocumentProperties
define append line of#undef DocumentProperties
immediately after the#include <dwrite.h>
. -
Move the
#include <dwrite.h>
line, and anything which uses its content, into another C++ source file of yours, where there is no UI stuff requiring the theme.
-
-
@dfger
dwrite.h
must be an MSVC header file, including definitions for its ownDocumentProperties
and it will have a line like#define DocumentProperties DocumentPropertiesW
which MSVC uses for the "wide character" version. Meanwhile you are trying to use some Qt-defined symbol of
DocumentProperties
for the theme. And these clash.Try one of the following:
-
Move the
#include <dwrite.h>
line to after the#include ui_mainwindow.h
. That may, or may not, be enough to make it work. -
If you do not need the MSVC
DocumentProperties
define append line of#undef DocumentProperties
immediately after the#include <dwrite.h>
. -
Move the
#include <dwrite.h>
line, and anything which uses its content, into another C++ source file of yours, where there is no UI stuff requiring the theme.
-