Friday, January 23, 2009

Compile gtk+ apps on Windows

If you've already googled this, you must know that you need MinGW and MSYS.

Here is an installer of MSYS 1.0.10
Install it with default settings.... (path: c:/msys/1.0)



They say you can find the lastest version of MSYS here:(I didn't find the .exe(Installer) of newest version)
http://sourceforge.net/project/showfiles.php?group_id=2435



Now install : MinGW

A better Howto of installing MSYS and MinGW (Actually the original) can be found here

After MSYS and MinGW are installed you need to install GTK+ development files and some other tools like pkg-config...
Now things are going to get messy. I don't know how to do this in another way but this works....

An installer of gtk+ dev files can be found here ( Last stable version....)
Default path of installation is c:/Program Files/Common or some windowsish path ....
Install it in the same path you installed MSYS (default MSYS installation path C:\msys\1.0\ )

If you want to, you can find the newer version of gtk+ dev files here
Then edit a file that should be here c:/msys/1.0/lib/pkgconfig/cairo.pc
Remove this part:" pixman-1 >= 0.10.0" or something like that (I can't remember exactly, I've already deleted that part LOL)

Don't forget to compile with this command:

gcc -Wall -g `pkg-config --cflags libglade-2.0` -o hello hello.c `pkg-config --libs libglade-2.0`

here is an explanation of why compiling that way....


Congratulations Now you can compile your gtk+ programs in Windows...
I think that this way is less painful than cross-compiling ......

P.S. Sorry for my bad English......

No comments: