You are using cmake with fltk 1.4, which you've built in this directory: /usr/lib/fltk-1.4/build
Detail: You shouldn't have build in the /usr/lib, you could build in your home directory (~) because /usr/lib is a directory to installed libs.
But, when you use g++ command line without specify the directories, you are using the Default include path and lib path. (Probably you are using the installed fltk with apt-get (1.3.4). )
If you want to use the lib and and headers of fltk 1.4 build, you need to specify it using -I and -L.
For example, if the fltk 1.4 build has the directories:
/usr/lib/fltk-1.4/build/include
/usr/lib/fltk-1.4/build/lib
So, you need to do:
g++ -w -Wall -std=c++11 -I/usr/lib/fltk-1.4/build/include -L/usr/lib/fltk-1.4/build/lib Graph.cpp Window.cpp GUI.cpp Simple_window.cpp main.cpp -lfltk -lfltk_images -o hello_fltk
And when the executable is exectuted, it needs to search the correct shared lib, so you need to change the LD_LIBRARY_PATH too before execute it:
# export LD_LIBRARY_PATH="/usr/lib/fltk-1.4/build/lib:$LD_LIBRARY_PATH"
(:$LD_LIBRARY_PATH at end keeps the previous other paths)
All this complications happen because you've choose to use a separated build directory instead to install the libs and headers in system default positions.
You can simplify it...
Remove the packages fltk, fltk-dev, etc, which is 1.3.4 probabily, using apt-get remove
enter in the build directory, which has a Makefile because your previous command "cmake ..", and do "make install"
Doing it, you will have the same lib and headers installed in your system that you have in your build directory, and the command line compilation will be simple, and without necessity of change LD_LIBRARY_PATH environment variable, and the "cmake method", makefile, and command line will work.
> Sent: Tuesday, June 19, 2018 at 9:49 PM