Skip to content
Discussion options

You must be logged in to vote

There's a linker flag /SUBSYSTEM on Windows that determines whether your application uses the command-line subsystem (where the entrypoint for the application is main and standard streams are preconfigured) or the Windows subsystem (where the entrypoint is WinMain and you need to explicitly configure the standard streams). It also controls whether a terminal window is spawned automatically if the parent process doesn't provide one.

For a CMake project, this is controlled by the WIN32_EXECUTABLE target property, which can be set by:

  • setting the property explicitly on a target after it's been declared.
  • setting the CMAKE_WIN32_EXECUTABLE variable before the target's declared.
  • passing WIN32

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rolandhill
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants