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
definein 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
definein 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.hmust be an MSVC header file, including definitions for its ownDocumentPropertiesand it will have a line like#define DocumentProperties DocumentPropertiesWwhich MSVC uses for the "wide character" version. Meanwhile you are trying to use some Qt-defined symbol of
DocumentPropertiesfor 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
DocumentPropertiesdefine append line of#undef DocumentPropertiesimmediately 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.hmust be an MSVC header file, including definitions for its ownDocumentPropertiesand it will have a line like#define DocumentProperties DocumentPropertiesWwhich MSVC uses for the "wide character" version. Meanwhile you are trying to use some Qt-defined symbol of
DocumentPropertiesfor 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
DocumentPropertiesdefine append line of#undef DocumentPropertiesimmediately 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.
-

