I am creating a project using Visual Studio 2019 on Windows 10 with wxWidgets 3.1.2. When I use wxIMPLEMENT_APP(), I get a warning and a green squiggle under the name of the macro. The code compiles and runs fine, but that squiggle is distracting. If I knew what needed to be changed in the wxWidgets code, I would fix it myself. The full warning text I'm getting is below.
Warning C28251, Inconsistent annotation for 'WinMain': this instance has no annotations. See c:\program files (x86)\windows kits\10\include\10.0.18362.0\um\winbase.h(933).
Warning C28251: Inconsistent annotation for 'WinMain'
-
- Experienced Solver
- Posts: 74
- Joined: Sat May 06, 2017 1:40 pm
Re: Warning C28251: Inconsistent annotation for 'WinMain'
As VS2019 is newer than wx3.1.2, could you please check if you get the same warning with the latest wx version from Github?
Use the source, Luke!
-
- Experienced Solver
- Posts: 74
- Joined: Sat May 06, 2017 1:40 pm
Re: Warning C28251: Inconsistent annotation for 'WinMain'
I just tried using the version from GitHub and got the same warning.
Dave F.
Re: Warning C28251: Inconsistent annotation for 'WinMain'
I have no VS2019 installed to test this right now and i also don't know if it's worth opening a bug report. But if you want, please do so at http://trac.wxwidgets.org/
Use the source, Luke!
Re: Warning C28251: Inconsistent annotation for 'WinMain'
I see the warning (it is IntelliSense warning, not a build one) as well.
If you google the warning , you will find what causes and how to fix it. I will report it, we will see if it is a worthy a fix (MSVC-specific WinMain?) or just a warning suppression.
JFYI, building this simple application
gives 121 wxWidgets IntelliSense warnings. The only difference from the one in the OP is there are no underlines visible in the user code for 120 of those. Most of the warnings is about unscoped enum, the rest are mostly false positives...
EDIT
I have created the ticket: https://trac.wxwidgets.org/ticket/18529
If you google the warning , you will find what causes and how to fix it. I will report it, we will see if it is a worthy a fix (MSVC-specific WinMain?) or just a warning suppression.
JFYI, building this simple application
Code: Select all
#include <wx/wx.h>
class MyApp : public wxApp
{
public:
bool OnInit() override
{
(new wxFrame(nullptr, wxID_ANY, "Test"))->Show();
return true;
}
}; wxIMPLEMENT_APP(MyApp);
EDIT
I have created the ticket: https://trac.wxwidgets.org/ticket/18529