This repository contains solutions to some problems from Bjarne Stroustrup's Principles of Programming Using C++ (2014). These solutions were written in Linux, but should work for any UNIX-like system.
You must install FLTK on your system in order to compile these programs. You can do this in Ubuntu by doing
sudo apt install libfltk1.3-devThe method to compile the GUI programs took several hours of trial and error to fix. The GUI code provided by Stroustrup had to be edited since I wasn't able to compile it. I've included a compile_fltk.sh file that you can use to compile. For example, for a file Test.cc, you do
./compile_fltk.sh Test.cHowever, if you can't compile with compile_fltk, you may need to do the following:
-
Copy-paste the output from fltk-config
fltk-config --cxxflags
-
Using g++, Include the fltk-images library by doing -lfltkimages
-
(OPTIONAL?) Include the local GUI library by doing -I./GUI
-
Place the name of your program and then its output file.
-
Run the entire command using g++