How to build FLTK with QT Creator and Ubuntu

The IDE I like to work with when programming C++ is Qt Creator. The library used in Programming: Principles and Practice using C++ is FLTK. Figures out that it is really easy to make it work under Ubuntu but I was struggling to find exact instructions for some reason. (Well, may be because most of linux guys know what they are doing unlike me 🙂 ).

Ok, here is what needs to be done.

First, fltk is available under in ubuntu as the package libfltk.


sudo apt-get install libfltk1.3

Next, locate the folder that  contains the library using. You are looking for .so file.

sudo dpkg -L libfltk1.3

You will see something like  /usr/lib/x86_64-linux-gnu/  as one of the files that depend on the package.

I am assuming that you are using qmake. Then add this line to your project.

LIBS += /usr/lib/x86_64-linux-gnu/

To check that everything is working, try to compile the following program.

#include <FL/Fl.h>;
#include <FL/Fl_Box.h>;
#include <Fl/Fl_Window.>

int main() {
  Fl_Window window{200, 200, "Window title"};
  Fl_Box box{0, 0, 200, 200, "Hey, I mean hello world\n"};;
  return Fl::run();
You should see a window with a message.

Have fun learning to program graphics!


One thought on “How to build FLTK with QT Creator and Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s