Page 1 of 1

MSVC 2019 Compiler Warnings

Posted: Wed May 17 2023 2:18 am
by jeffw
Hello,

When compiling Copperspice 1.8.1 on Windows 11 with MSVC 2022 (compiling 2019 project) I get the following error related to CS_OBJECT

warning C5030: attribute 'gnu::used' is not recognized

class FileSelectionWidget : public QWidget
{
CS_OBJECT(FileSelectionWidget)
...
}

Where can I find this defined in the source?

Thanks,
Jeff

PS: Thanks for CopperSpice!

Re: MSVC 2019 Compiler Warnings

Posted: Fri May 19 2023 7:44 pm
by barbara
MSVC 2022 (compiling 2019 project
1 Are you trying to build CopperSpice with MSVC 2022 and your application with MSVC 2019?

2 As a side note, MSVC needs everything built in either debug or release. Mixing the two does not always work as expected.
warning C5030: attribute 'gnu::used' is not recognized
3 Compilers are required to ignore attributes they do not recognize or handle. We are not seeing any warnings about this attribute in our CI testing on MSVC. Can you let us know which options you have turned on when building CS and if this shows up in both versions of MSVC you are using.

Barbara