Compiling GTK+ applications on windows?

2019-05-15 04:07发布

I was following this thread in order to learn gtk but I cant seem to get it to compile. I've downloaded the GTK all in one bundle and extracted it to c:\gtk (have also set bin as a path variable), but when I try gcc foo.c %VAR% it says gcc: %VAR%: No such file or directory, what am I missig here?.

this is my VAR.bat file

set VAR = -mms-bitfields -IC:/gtk/include/gtk-2.0 -IC:/gtk/lib/gtk-2.0/include -IC:/gtk/in
clude/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -IC:/gtk/include
/glib-2.0 -IC:/gtk/lib/glib-2.0/include -IC:/gtk/include -IC:/gtk/include/freety
pe2 -IC:/gtk/include/libpng14  -LC:/gtk/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -lat
k-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpan
go-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl

start cmd

and I have this in the same directory as foo.c

2条回答
别忘想泡老子
2楼-- · 2019-05-15 05:04

You can use Dev-C++ to compile GTK+ applications. Please follow this introduce http://users.libero.it/efa/gtkDev-C++En.html

查看更多
Summer. ? 凉城
3楼-- · 2019-05-15 05:09

Remove the spaces around the equals sign in the bat file:

C:\Users\unwind>set a = hello

C:\Users\unwind>echo %a%
%a%

C:\Users\unwind>set a=hello

C:\Users\unwind>echo %a%
hello
查看更多
登录 后发表回答