IMPLEMENT_APP()
or, better, wxIMPLEMENT_APP() is a macro which must occur in the global scope, you can't put it inside the main()
function.
And, in fact, if you use it, you don't need main()
at all as it is generated by this macro expansion.
Finally, while you didn't hit this problem yet, once the code compiles it probably won't link because you chose the wrong application type: it should be a "GUI" (or maybe "Windows") and not a "console" application.