Posted: Wed 14 Oct 2009, 15:14 Post_subject:
Compiling first cairo graphics (hello world) program
Hi everyone. I'm a retread from various other computer systems. Windoze, Amiga, AtariTT, and most of my programming experience has been assembler. Ok, so I've got the compiler up and working and doing small routines to print to text to the terminal, beep the speaker, talk to a device on a serial port and so forth. My partner wants me to show him an example of drawing a line on the screen and my friend (and doctor) told me to use the cairo graphics scheme of doing this. I downloaded the "hello.c" source and tried to compile it and got the missing file cairo.h message. I've downloaded the .pet of cairo for users and developers and have a set of .h files but.... I don't grock how to point the compiler to this other then to put a path in my source which I assume is pretty crude?
Sorry to be a putz with so many questions but it always seems to take me a while to get started. Once going I'm better!
g++ -o cairo1 -I/usr/include/cairo cairo1.c
*note this is where the cairo.h really is located /usr/include/cairo
/tmp/cccu1vWh.o: In function 'main':
and then the same long list of undefined reference to things in the cairo.h file such as 'cairo_image_surface_create'
I was using the ' ' (quotes) key not the ` ` key to set some of the compiler options I got my little crude line drawing routine to click along and I'm sorry for the frantic questions. I can't quite express how excited I am about this.
A couple of observations. Speed wise this is amazing. I'm told this (4.30) as downloaded from the web is not really "trimmed down" fully for speed! I am really really pleased as its making my "junk" laptop the computer I "used" to love but even more. Because as dumb as I am at figuring things out they CAN be figured out.
One thing that really pleases me which is such a small thing. The computer is not constantly reading the hard disk on its own for unknown reasons. Having a minimum of these "squirrel" programs running in the background is SOoooooo nice...