wxIMPLEMENT_APP macro error

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
tophat17
In need of some credit
In need of some credit
Posts: 1
Joined: Fri Mar 12, 2021 8:14 am

wxIMPLEMENT_APP macro error

Post by tophat17 » Fri Mar 12, 2021 8:24 am

Hello.

I am trying to get wxWidgets set up in Visual Studio 2019, as shown in javidx9's video "Cross Platform Graphical User Interfaces in C++". I followed his instructions exactly and was left with one compilation error that reads " 'static_cast': cannot convert from 'wxAppConsole*' to 'cApp*'"

I'm not sure what to do or how to solve this error. Any advice would be appreciated. Thanks.

My "cApp.cpp" is shown below:

Code: Select all

#include "cApp.h"

wxIMPLEMENT_APP(cApp);

cApp::cApp()
{

}
cApp::~cApp()
{

}
bool cApp::OnInit()
{
	m_frame1 = new cMain();
	m_frame1->Show();

	return true;
}

User avatar
doublemax
Moderator
Moderator
Posts: 16200
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxIMPLEMENT_APP macro error

Post by doublemax » Fri Mar 12, 2021 9:36 am

Please show the content of "cApp.h"

And you should not override the constructor.

In general, i think it's easier to just start with the "minimal" sample that comes with wxWidgets.
Use the source, Luke!

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 5226
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxIMPLEMENT_APP macro error

Post by ONEEYEMAN » Fri Mar 12, 2021 1:20 pm

Hi,
In addition - it is much easier to follow OFFICIAL DOCUMENTATION, and not something you find on the web.

Thank you.

Post Reply