Compiling GTK+ applications on windows?

☆樱花仙子☆ 提交于 2019-12-07 15:53:29

问题


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


回答1:


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



回答2:


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



来源:https://stackoverflow.com/questions/4282567/compiling-gtk-applications-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!