www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - Compiling a GUI-only EXE

reply GreatEmerald <pastas4 gmail.com> writes:
I am trying to compile a program that uses a GUI, and I want to get rid of the
console that I get every time I launch the program. I thought that passing the
-WA argument to DMC would solve the issue, but it doesn't seem to be the case.
I still get the console, with or without the option.

Is there something else that I'm missing here?

Note that there is output in the console, caused by libraries used by the
program, but I don't think they would make the console appear by themselves
(anything in stdout should simply be dropped).
Mar 16 2012
parent reply "alex" <info alexanderbothe.com> writes:
On Friday, 16 March 2012 at 20:32:57 UTC, GreatEmerald wrote:
 I am trying to compile a program that uses a GUI, and I want to 
 get rid of the
 console that I get every time I launch the program. I thought 
 that passing the
 -WA argument to DMC would solve the issue, but it doesn't seem 
 to be the case.
 I still get the console, with or without the option.

 Is there something else that I'm missing here?

 Note that there is output in the console, caused by libraries 
 used by the
 program, but I don't think they would make the console appear 
 by themselves
 (anything in stdout should simply be dropped).

try to add -LEXETYPE:NT -LSUBSYSTEM:WINDOWS to the cmd line
Mar 16 2012
parent GreatEmerald <pastas4 gmail.com> writes:
Aha, thanks, that led me to the right answer!

For one, it's '-L/' and not '-L' (otherwise it's a path to a custom linker). But
even then, it didn't compile with both of these commands, throwing this strange
message:

    &#256; was unexpected at this time.

However, by trial and error I found out that passing only "-L/SUBSYSTEM:WINDOWS"
did the trick!
Mar 16 2012