user1741137
user1741137

Reputation: 5058

visual studio 2019 for wxWidgets: link problem

I'm trying to follow what I saw here: I start off by creating an "Empty project" and use just two source files as indicated in the link. I also use the wwwidgets.props file to make the properties of my project conformant. Unfortunately there is a huge list of warnings on compilation, but worst of all, an error which says that LNK2019 unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) This sounds like I've used a bad compilation option, but which?

Upvotes: 0

Views: 143

Answers (2)

user1741137
user1741137

Reputation: 5058

You can create an empty console project for this but you must apply the following modifications: follow VZ's advice and change the Linker|System|Subsystem option to Windows, for all the configurations (Release and Debug). I also changed the C++ preprocessor macro from _CONSOLE to _WINDOWS and I applied the wxwidgets.props file with the Property manager.

Actually I had asked an almost identical questions a few months back, was very unwell in the meantime and came back forgetting the post.

Upvotes: 0

VZ.
VZ.

Reputation: 22688

Most likely you've created a new console project rather than a new GUI ("Windows") project, check the "Linker|System|SubSystem" option in the properties dialog.

As for the warnings, you should really should at least a couple of them to give us a fighting chance of figuring out where do they come from.

Upvotes: 1

Related Questions