Haha, yeah my bad. You would think that I would have done that. Sorry!
Here is the code that I have saved as hw.c:
Code: Select all
// first OpenVG program
// Anthony Starks (ajstarks@gmail.com)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "VG/openvg.h"
#include "VG/vgu.h"
#include "fontinfo.h"
#include "shapes.h"
int main() {
int width, height;
char s[3];
init(&width, &height); // Graphics initialization
Start(width, height); // Start the picture
Background(0, 0, 0); // Black background
Fill(44, 77, 232, 1); // Big blue marble
Circle(width / 2, 0, width); // The "world"
Fill(255, 255, 255, 1); // White text
TextMid(width / 2, height / 2, "hello, world", SerifTypeface, width / 10); // Greetings
End(); // End the picture
fgets(s, 2, stdin); // look at the pic, end with [RETURN]
finish(); // Graphics cleanup
exit(0);
}
When I try to compile with either of the following command lines, it will error out with:
Code: Select all
/tmp/cco5gLn6.o: In function `main':
hw.c:(.text+0x24): undefined reference to `init'
hw.c:(.text+0x38): undefined reference to `Start'
hw.c:(.text+0x48): undefined reference to `Background'
hw.c:(.text+0x5c): undefined reference to `Fill'
hw.c:(.text+0x90): undefined reference to `Circle'
hw.c:(.text+0xa4): undefined reference to `Fill'
hw.c:(.text+0x124): undefined reference to `TextMid'
hw.c:(.text+0x128): undefined reference to `End'
hw.c:(.text+0x148): undefined reference to `finish'
collect2: ld returned 1 exit status
I've tried:
Code: Select all
gcc -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -L/opt/vc/lib -lGLESv2 hw.c -o hw
and
Code: Select all
cc -Wall -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -o hw hw.c -L/opt/vc/lib -lGLESv2
with the same results. I am running Raspbian, the version before 2013-09-25 but I did do a
rpi-update yesterday.
Any help would be greatly appreciated since I am trying to code a UI that will run from the command line and this looks like it will work nicely if I can get it to compile. Thanks again!