MS Windows C++ programming using gcc with GTK 1.x
This page provides the needed info how to create a small programming enviroment in MS Windows that uses C++ to create GUI applications.
Gcc compiler is used with GTK 1.x toolkit for GUI and JFE editor.
Downloads:
- GCC for windows : gcc-2.95-mingw32.zip
- Glib : glib-dev-2.2.3-20040116.zip
- Gtk 1.3 for windows : gtk+-dev-1.3.0-20030115.zip
Download also the corresponding runtime files gtk+-1.3.0-20040315.zip, glib-2.4.5.zip.
libiconv and libintl also must be downloaded as they are used by glib. The dll's in these are needed during runtime.
Gcc can be found here:
http://mill2.chem.ucl.ac.uk/ccp/ccp14/ftp-mirror/programming/mumit-khan/pub/khan/gnu-win32/mingw32/
Glib and gtk here:
http://coast.cs.purdue.edu/pub/tools/unix/netutils/ethereal/win32/development/
A very simple c++ editor you can download is JFE editor, can be found here:
https://www.downloadsource.net/1755602/jfe-jens-file-editor/
Setup:
Extract the zip file of Gcc, Glib and Gtk in a path like C:\gcc
Set the enviroment variables:
(They can be in control panel of windows XP or in a bat file before compiling and linking commands)
SET PATH=C:\GCC\BIN;%PATH%
SET LIBRARY_PATH=c:\gcc\lib
SET C_INCLUDE_PATH=c:\gcc\include\glib-2.0;c:\gcc\lib\gtk+\include;c:\gcc\lib\glib-2.0\include
SET CPLUS_INCLUDE_PATH=%C_INCLUDE_PATH%
Now gcc with gtk is ready. In order to make a compilation (of test.cpp) use the command :
gcc -c -s -mwindows -mno-cygwin -fnative-struct -mcpu=pentium test.cpp
In order to make the linking:
gcc -s -mwindows test.o -lglib-2.0.dll -lgtk.dll -lgdk.dll -lstdc++
a.exe will be the result.
The runtile dll's you downloaded must be in the same path with a.exe produced.
[Back to main page]