关闭

gtk+3.0 windows配置

728人阅读 评论(0) 收藏 举报
分类:

下载gtk+3.0,解压到d盘根目录

http://www.gtk.org/download/index.php

D:\gtk3\bin 添加到环境变量

pkg-config --libs --cflags gtk+-3.0

输出:

-mms-bitfields -ID:/gtk3/include/gtk-3.0 -ID:/gtk3/include/cairo -ID:/gtk3/include/pango-1.0 -ID:/gtk3/include/atk-1.0 -ID:/gtk3/include/cairo -ID:/gtk3/include/pixman-1 -ID:/gtk3/include -ID:/gtk3/include/freetype2 -ID:/gtk3/include -ID:/gtk3/include/libpng15 -ID:/gtk3/include/gdk-pixbuf-2.0 -ID:/gtk3/include/libpng15 -ID:/gtk3/include/glib-2.0 -ID:/gtk3/lib/glib-2.0/include -LD:/gtk3/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig -lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl 

1. vs

属性→C/C++→常规→附加包含目录(-I后面的那一串)

D:/gtk3/include/gtk-3.0;D:/gtk3/include/cairo;D:/gtk3/include/pango-1.0;D:/gtk3/include/atk-1.0;D:/gtk3/lib/glib-2.0/include;D:/gtk3/include/glib-2.0;D:/gtk3/include/libpng15;D:/gtk3/include/gdk-pixbuf-2.0;D:/gtk3/include;D:/gtk3/include/freetype2;D:/gtk3/include/pixman-1

属性→连接器→常规→附加库目录(-L后面那个)

D:/gtk3/lib

属性→连接器→输入→附加依赖项(-l后面的那些东西,不够windows下要用文件名)

atk-1.0.lib;gdk-win32-3.0.lib;gmodule-2.0.lib;pango-1.0.lib;cairo.lib;gdk_pixbuf-2.0.lib;gobject-2.0.lib;pangocairo-1.0.lib;fontconfig.lib;gio-2.0.lib;gthread-2.0.lib;pangoft2-1.0.lib;gailutil.lib;glib-2.0.lib;gtk-win32-3.0.lib;pangowin32-1.0.lib

vs生成的程序会有个dos窗口,在cpp中添加

#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")

即可

2. eclipse

Properties→C/C++ Build→Settings

GCC C++ Compiler

GCC C Compiler

-I

D:/gtk3/include/gtk-3.0
D:/gtk3/include/cairo
D:/gtk3/include/pango-1.0
D:/gtk3/include/atk-1.0
D:/gtk3/include/cairo
D:/gtk3/include/pixman-1
D:/gtk3/include
D:/gtk3/include/freetype2
D:/gtk3/include
D:/gtk3/include/libpng15
D:/gtk3/include/gdk-pixbuf-2.0
D:/gtk3/include/libpng15
D:/gtk3/include/glib-2.0
D:/gtk3/lib/glib-2.0/include

MinGW C Linker

MinGW C++ Linker

-l

gtk-3
gdk-3
gdi32
pangocairo-1.0
pangoft2-1.0
fontconfig
pangowin32-1.0
gdi32
pango-1.0
atk-1.0
cairo-gobject
cairo
gdk_pixbuf-2.0
gio-2.0
gobject-2.0
glib-2.0

-L

"D:\gtk3\lib"

gcc的dos窗口-mwindows即可消去

linker的Miscellaneous的flags中添加即可


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:54470次
    • 积分:1551
    • 等级:
    • 排名:千里之外
    • 原创:102篇
    • 转载:18篇
    • 译文:0篇
    • 评论:3条
    文章分类
    最新评论