Windos 10 - cmd.exe window appears when strating gui app Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
K.Nick
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Aug 17, 2022 9:08 am

Windos 10 - cmd.exe window appears when strating gui app

Post by K.Nick »

Hi,

in Windows 10, when I click on my compiled wxWidgets app in addition to the expected app window a cmd.exe window appears (see screen shot below). Any ideas how to fix that?

To demonstrate the behaviour I have created a zip archive https://ufile.io/5u3bipm4 containing the source file in question, the resulting compiled exe and the dll files needed (these are needed on my machine).

My compiler arguments are:
g++ -Wall -o HelloWorld.exe HelloWorld.cpp -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:/Users/me/Software/wxWidgets/3.2.0_gcc1210/lib/gcc1210_x64_dll/mswu -IC:/Users/me/Software/wxWidgets/3.2.0_gcc1210/include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -mthreads -LC:/Users/me/Software/wxWidgets/3.2.0_gcc1210/lib/gcc1210_x64_dll -lwxmsw32u_richtext -lwxmsw32u_xrc -lwxmsw32u_aui -lwxmsw32u_html -lwxmsw32u_adv -lwxmsw32u_core -lwxbase32u_xml -lwxbase32u_net -lwxbase32u -lwxscintilla -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32

To be honest I am new to wxWidgets (and especially compiling software for Windows), I don't know wheather this is an include issue, a compiler (argument) issue, a library issue or something completely different.

So any help about why this happens and how to fix it is appreciated.

cmd.png
cmd.png (57.6 KiB) Viewed 1120 times
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: Windos 10 - cmd.exe window appears when strating gui app

Post by doublemax@work »

Add "-mwindows" to the command line parameters.
K.Nick
Knows some wx things
Knows some wx things
Posts: 27
Joined: Wed Aug 17, 2022 9:08 am

Re: Windos 10 - cmd.exe window appears when strating gui app

Post by K.Nick »

Yepp - works for me. =D>

Thanks a lot.
Post Reply