(its a long story) but I have a large complex project file containing a windows program. Unfortunately the project was originally built as a console app. The program compiles and links ok but when runs brings up a console instead of the collection of windows I was hoping for. I looked at the command line and saw "/SUBSYSTEM:CONSOLE" whereas it should be "/SUBSYSTEM:WINDOWS". I have no idea how to change the command line. Is there some box I can tick in the project setting somewhere to make this change?
Asked
Active
Viewed 2.1k times
2 Answers
47
Right-click the project icon in the Solution Explorer, then Properties > Linker > System > SubSystem, and set that to Windows. You'll also have to change your main()
method to WinMain()
. And you'd better create some windows or there won't be much to look at.

deLock
- 762
- 8
- 16

Hans Passant
- 922,412
- 146
- 1,693
- 2,536
12
Complementing Hans' answer: While under Properties, also remember to expand the C/C++ node and select Preprocessor. Then edit the Preprocessor Definitions - replace _CONSOLE
with _WINDOWS
.

Marc.2377
- 7,807
- 7
- 51
- 95
-
_WINDOWS undefined if the Windows subsystem set in linker – Sergei Krivonos Nov 15 '16 at 13:48