1

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

user1767754
  • 23,311
  • 18
  • 141
  • 164

1 Answers1

2

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")
Community
  • 1
  • 1
datenwolf
  • 159,371
  • 13
  • 185
  • 298