FLTK

From ALT Linux Wiki
Revision as of 07:30, 15 July 2020 by Retrograde (talk | contribs) (Initial creation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This document describes the capabilities of the ALT Linux family of distributions for building lightweight portable applications. using the FLTK library.

Installation

Install the following packages after updating the indices of the package base, and possibly the entire systems:

apt-get install libfltk-devel libfltk-doc

The installation of the documentation package can be omitted if there is Internet access.

libfltk13 package

The package contains the /usr/bin/fluid utility for developing a graphical interface with related C ++ source code. But the main purpose of the package is shared execution libraries for running FLTK-based applications. Also there is a reference manual in nroff format.

libfltk-dev package

libfltk-dev package contains the /usr/bin/fltk-config utility for obtaining information about the applications compilation and building options from source code in the current software environment. Unfortunately, the static library (*.a) are not provided in the distribution available to the author, although FLTK applications are often linked with it. Thats why, only build options with a shared library (* .so) will be considered.

libfltk13-doc package

Contains help files in HTML / PNG / format, etc. in the directory: /usr/share/doc/fltk-1.3.3/html

In this case, the input point in the browser will be file:///usr/share/doc/fltk-1.3.3/html/index.html

An example of building a simple application with a button

Write the C ++ code in your favorite editor to the ok_btn.cxx </ tt> file with the following contents:

#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();
}

Lets start the compilation and building application from the source code in the command line: `fltk-config --cxx` `fltk-config --cxxflags` ok_btn.cxx -o ok_btn `fltk-config --ldflags` Run the builded binary file: ./ok_btn

References