win32下的GTK+程序开发

最近一直在学上位机的编程,找一些相关的东西,确定了使用的compiler, lib和IDE环境.

要求:

compiler:MinGW

lib:跨平台,那是必须的,最好用C/C++,还有其他语言的绑定.拒绝M$的东西.

IDE:不要太简陋就好,最后的目标是不使用IDE的环境.

最后选择:GTK+ , CODE::BLOCKS

1.GTK+

GTK+使用C.没入门难度.(如果你喜欢用C++的话,wxWidgets也是不错的选择.)

1.1 安装

1.1.1 需求

You will need the GLib, cairo, Pango, ATK, gdk-pixbuf and GTK+ developer packages to build software against GTK+. To run GTK+ programs you will also need the gettext-runtime, fontconfig, freetype, expat, libpng and zlib packages.

编译和运行GTK+的程序,需要不同的lib.

1.1.2 下载

There are three types of downloads below. Run-time provide only the DLLs and other files used you will need to run a GTK+-using application. Dev packages provide include files, import libraries, documentation and additional tools, and also for reference the script used to build the component in question. In case patches have been applied to the upstream sources before building, these are inline in the build script. Source packages provide the source code for the component in question. In most cases, this is simply the pristine upstream source release tarball, possibly copied to the same server as the binaries to satisfy the license.

所有的lib可以单独的下载,包括run-time,dev和source.

If you find choosing, downloading and unpacking the individual zip archives below a chore, there are all-in-one bundles of the GTK+ stack including 3rd-party dependencies, both of GTK+ 2.16 and 2.22. The bundles contain both run-time and developer files. Many of the developer files are relatively irrelevant. If you intend to redistribute the GTK+ run-time, you need to figure out which files you can leave out yourself. A new bundle will ideally be provided here whenever one of the member packages has been updated.

也可以下一个all-in-one bundles,最新的是2.22,2.24还没有封装好的.

note:要记得添加系统PATH,如 D:\GTK_win32\bin

2.IDE

Eclipse和Code::Blocks

2.1 Eclipse

2.2 Code::Blocks(CB for short)

用C++写的C++的IDE,还是很不错的.

2.2.1 compiler

MinGW,CB会自动检测到MinGW的安装.当然也是可以自己指定位置,CB-->settings-->compiler and dubuger ... -->global compiler settings -->

toolchain executable.

2.2.2 pkg-config

CB-->settings-->compiler and dubuger ... -->global compiler settings -->compiler settings --> other options,添加

`pkg-config --cflags gtk+-2.0`

CB-->settings-->compiler and dubuger ... -->global compiler settings -->linker settings --> other linker options,添加

`pkg-config --libs gtk+-2.0`

note:我删除了Global variable中的base,发现也是可以正确编译.

2011061513314520.gif

转载于:https://www.cnblogs.com/darwin/archive/2011/06/15/2081424.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值