zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    POJ 2031 Building a Space Station (最小生成树)
    HDU 1875 畅通工程再续 (最小生成树)
    HDU 1233 还是畅通工程 (最小生成树)
    POJ 1679 The Unique MST (最小生成树)
    js调试工具console详解
    使用阿里云集成包快速搭建LAMP+FTP教程
    PHP使用纯真IP数据库
    mysql配置文件my.cnf解析
    Javascript常用函数收集(不定期更新)
    性能测试工具:AB
  • 原文地址:https://www.cnblogs.com/cutepig/p/2173056.html
Copyright © 2011-2022 走看看