I'm using Programming: Practice and Principles Using C++ and I've hit a roadblock. Chapters 12-16 cover GUI programming and require the use of the Fast Light Toolkit. Here is what I've done so far. If you need more information I'd be happy to provide.
1. Using Dev-C++'s "Check for Updates and Packages," I downloaded and installed FLTK package.
2. Created new GUI FLTK project (this is now available since I installed package).
3. Added header files and cpp file to project (the cpp file calls header files which call headers from FLTK include folder)
Here's where it gets tricky.
At first I was getting compiler errors like Fl.h (things that are part of FLTK library) is unavailable. Then I went to project options - include directories - and included the folder from the FLTK folder that held those headers(wasn't sure why I had to do this since the project was an FLTK project). Now I'm getting linker errors of undefined references to objects such as
undefined reference to Simple_window::Simple_window(Point, int, int, string const)
I removed the directories I included, but I still get the linker errors instead of the compiler errors. I guess this is a step in the right direction...but I'm not sure where to go from here.
The header files that call on the FLTK headers can be found here.
http://www.stroustrup.com/Programming/Graphics/
Here is the cpp file code
#include "Simple_window.h" // get access to our window library
#include "Graph.h" // get access to our graphics library facilties
int main()
{
using namespace Graph_lib; // our graphics facilities are in Graph_lib
Point tl(100,100); // to become top left corner of window
Simple_window win(tl,600,400,"Canvas"); // make a simple window
Polygon poly; // make a shape (a polygon)
poly.add(Point(300,200)); // add point
poly.add(Point(350,100)); // add another point
poly.add(Point(400,200)); // add a third point
poly.set_color(Color::red); // adjust properties of poly
win.attach(poly); // connect poly to window
win.wait_for_button(); // give control to display engine
}
Basically I have headers that include the FLTK headers, and for some reason this causes problems.