qt报错:In included file: expected member name or ‘;‘ after declaration specifiers

The error is reported as follows. If qt refers to files in the same directory, an error will be reported.
insert image description here
The console will output the following:
insert image description here

Reason for error: The reference in the file pointed by the arrow may conflict with other files.

Double-click the first line of the error to open the file, and then it will automatically locate the line of the error
insert image description here

Modify as follows, add the next two lines of code:
insert image description here
the format is as follows:
#undef variable name
#define variable name variable type

You can see another blogger https://blog.csdn.net/weixin_41560737/article/details/127269010 for the modification of the signal slot, which is also in the above format
insert image description here

Match and modify according to the above format, then save, rebuild, compile and run, and no error will be reported!

Guess you like

Origin blog.csdn.net/changyana/article/details/129792779