fltk试用 (1)

先安装基本的库,用aptget可以自动安装依赖
sudo apt-get install libfltk1.1-dev libfltk1.1

下载一个最新的源代码,编译

tar avzf fltkxxx
cd fltkxxx
./configure
make
sudo make install

cutepig@ubuntu:~/Downloads/fltk-1.3.0$ sudo make install
=== installing FL ===
Installing include files in /usr/local/include...
=== installing jpeg ===
Installing ../lib/libfltk_jpeg.a in /usr/local/lib...
Installing jpeg headers in /usr/local/include/FL/images...
=== installing zlib ===
Installing libfltk_z.a in /usr/local/lib...
Installing zlib headers in /usr/local/include/FL/images...
=== installing png ===
Installing libfltk_png.a in /usr/local/lib...
Installing png headers in /usr/local/include/FL/images...
=== installing src ===
Installing libraries in /usr/local/lib...
=== installing fluid ===
Installing FLUID in /usr/local/bin...
=== installing test ===
Installing example programs to /usr/local/share/doc/fltk/examples...
=== installing documentation ===
Installing documentation files in /usr/local/share/doc/fltk ...
Installing man pages in /usr/local/share/man ...
cutepig@ubuntu:~/Downloads/fltk-1.3.0$

写一个例子程序
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
 
int main(int argc, char *argv[]) {
   Fl_Window* w = new Fl_Window(330, 190);
   new Fl_Button(110, 130, 100, 35, "Okay");
   w->end();
   w->show(argc, argv);
   return Fl::run();
}

编译运行

g++ test.cpp -lfltk  -lX11 -lm

参考网址

下载源代码

http://www.fltk.org/

入门文档

http://www.fltk.org/documentation.php/doc-1.1/basics.html#basics

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值