So I have been trying to set up the FLTK library for use with g++. I have installed FLTK and I can compile the test example in its documentation without error. I am following Bjarne Stroustrups Programming: Principles and Practice, 2nd edition, and for the 12th chapter you need to get FLTK going.
I had a large number of issues that had to be resolved since the code Stroustrup provides (and that you need to make work for his examples) doesn't seem to function with current versions of FLTK, and I think I managed to do that, but currently I seem to have a linker problem that my probably somewhat under qualified guess suggests has to do with FLTK and how I installed it rather than any errors in the by Stroustrup provided code. The line I am using the compile my test code (Helloworld.cpp) is the following:
g++ -std=c++11 -Wextra -pedantic -I/usr/local/include -I/usr/local/include/FL/images -I/usr/include/freetype2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT Helloworld.cpp src/Graph.cpp src/GUI.cpp src/Window.cpp -L/usr/local/lib -lfltk -lXfixes -lXext -lXft -lfontconfig -lpthread -ldl -lm -lX11 -ljpeg -Os -Wall -Wunused -Wno-format-y2k -fno-exceptions -fno-strict-aliasing -ffunction-sections -fdata-sections -fexceptions -o HelloWorld
/tmp/ccD2Ev5l.o: In function `Graph_lib::Image::Image(Graph_lib::Point, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, Graph_lib::Suffix::Encoding)':
Graph.cpp:(.text._ZN9Graph_lib5ImageC2ENS_5PointENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6Suffix8EncodingE+0x119): undefined reference to `Fl_JPEG_Image::Fl_JPEG_Image(char const*)'
Graph.cpp:(.text._ZN9Graph_lib5ImageC2ENS_5PointENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_6Suffix8EncodingE+0x137): undefined reference to `Fl_GIF_Image::Fl_GIF_Image(char const*)'
collect2: error: ld returned 1 exit status
-lfltk_images. Those image related functions have their own library.