Using Horstmann's Graphics Libraries in the Linux EnvironmentCharles Rumford Feb. 2006 |
I found instructions on using the CCC library in Linux on the Internet. I have included a few screen shoots along with some slightly modified library code (see links below). I rewrote the error system so that it displays to the console that you run the program from.
This assumes that the file that contains your code is named graphics.cpp. You need to have in the folder with your code the following files (modified slightly from the ones provided by Horstmann):

The skeleton of your code needs to look like this:
#include "ccc_x11.h" int ccc_win_main() { // Graphics Code goes here: Point p(1, 3); cwin << p << Circle(p, 2.5); return 0; }
The command that you need to compile is:
g++-4.0 graphics.cpp ccc_x11.cpp ccc_shap.cpp -L /usr/X11R6/lib -lX11 -o program
(This compiles your program ("graphics.cpp") along with the x11 and shap libraries and produces an executable file called program.)

Once you have compiled your code using the command above, you just need to type in the following command in your console:
./program
