Starting WxWidgets on Code::Blocks

When I run a wx Hello World program nothing happens. There are no build errors or anything.

build log:

-------------- Clean: Release in firstwx (compiler: GNU GCC Compiler)---------------

Cleaned "firstwx - Release"

-------------- Build: Release in firstwx (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -O2 -IC:\WxWidgets\include -IC:\WxWidgets\lib\gcc_dll\mswu -c C:\Users\Bob\OneDrive\Code\firstwx\firstwxMain.cpp -o obj\Release\firstwxMain.o
mingw32-g++.exe -LC:\WxWidgets\lib\gcc_dll -o bin\Release\firstwx.exe obj\Release\firstwxMain.o -s -mthreads -lwxmsw30u -mwindows
Output file is bin\Release\firstwx.exe with size 129.00 KB

What I have:
1
2
3
4
5
6
7
8
#include <wx/string.h>

int main(int argc, char* argv[])
{

wxPuts(wxT("Hello, world!"));

}
Last edited on
hi,
your problem is, the application closes without anything
it is better to have this inside your wxWidgets:
1
2
3
4
5
6
7
8
9
10
#include <wx/string.h>
#include <stdlib.h>

int main(int argc, char* argv[])
{

wxPuts(wxT("Hello, world!"));
system("pause");
return 0;
}

it should work now
but if you want it to be closed, you don't need to call system("pause");
if you want to see the result from your first code, just run your application from command line
Topic archived. No new replies allowed.