Frage

The OpenGl SuperBible Examples are shipped with the Property "/SUBSYSTEM:WINDOWS", which eliminates the console window, if i am trying to use "/SUBSYSTEM:Console" to start with console i get the error:

error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

However the main function is redirected by the example files with

DECLARE_MAIN(singlepoint_app)

In this file DECLARE_MAIN is declared: Link

War es hilfreich?

Lösung

Essentially what you're trying to do is the reverse of what I described in https://stackoverflow.com/a/6882500/524368

Your code examples use WinMain for the entry point but changing to the console subsystem by defaults uses the int main(int argc, char *argv[]) entry point as defined by the C standard.

So you can use this

/SUBSYSTEM:console
/ENTRY:WinMainCRTStartup

Or use the following #pragma in the source file with the WinMain

#pragma comment(linker, "/SUBSYSTEM:console /ENTRY:WinMainCRTStartup")
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top