Habe die Libs installiert nun stoße ich zum zweiten hinderniss:
#include <GL/gl.h> #include <GL/glut.h> void display (void) { glClear (GL_COLOR_BUFFER_BIT); glColor3f (1.0, 1.0, 1.0); glBegin(GL_POLYGON); glVertex3f (0.25, 0.25, 0.0); glVertex3f (0.75, 0.25, 0.0); glVertex3f (0.75, 0.75, 0.0); glVertex3f (0.25, 0.75, 0.0); glEnd(); glFlush (); } void init (void) { glClearColor (0.0, 0.0, 0.0, 0.0); glMatrixMode (GL_PROJECTION); glLoadIdentity(); glOrtho (0.0, 1.0, 0.0, 1.0, -1.0, 1.0); } int main(int argc, char **argv) { glutInit (&argc, argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (250, 250); glutInitWindowPosition (100, 100); glutCreateWindow("GlutTest"); init (); glutDisplayFunc (display); glutMainLoop(); return 0; }
Wenn ich versuche das zu kompilieren kommt:
etienne@xecto:~/Projects/adresse$ gcc adresse.cpp -o bin/gl /tmp/ccCoeKGw.o(.text+0xe): In function `display()': : undefined reference to `glClear' /tmp/ccCoeKGw.o(.text+0x2d): In function `display()': : undefined reference to `glColor3f' /tmp/ccCoeKGw.o(.text+0x39): In function `display()': : undefined reference to `glBegin' /tmp/ccCoeKGw.o(.text+0x58): In function `display()': : undefined reference to `glVertex3f' /tmp/ccCoeKGw.o(.text+0x77): In function `display()': : undefined reference to `glVertex3f' /tmp/ccCoeKGw.o(.text+0x96): In function `display()': : undefined reference to `glVertex3f' /tmp/ccCoeKGw.o(.text+0xb5): In function `display()': : undefined reference to `glVertex3f' /tmp/ccCoeKGw.o(.text+0xba): In function `display()': : undefined reference to `glEnd' /tmp/ccCoeKGw.o(.text+0xbf): In function `display()': : undefined reference to `glFlush' /tmp/ccCoeKGw.o(.text+0xf0): In function `init()': : undefined reference to `glClearColor' /tmp/ccCoeKGw.o(.text+0xfc): In function `init()': : undefined reference to `glMatrixMode' /tmp/ccCoeKGw.o(.text+0x101): In function `init()': : undefined reference to `glLoadIdentity' /tmp/ccCoeKGw.o(.text+0x12d): In function `init()': : undefined reference to `glOrtho' /tmp/ccCoeKGw.o(.text+0x152): In function `main': : undefined reference to `glutInit' /tmp/ccCoeKGw.o(.text+0x15e): In function `main': : undefined reference to `glutInitDisplayMode' /tmp/ccCoeKGw.o(.text+0x172): In function `main': : undefined reference to `glutInitWindowSize' /tmp/ccCoeKGw.o(.text+0x186): In function `main': : undefined reference to `glutInitWindowPosition' /tmp/ccCoeKGw.o(.text+0x192): In function `main': : undefined reference to `glutCreateWindow' /tmp/ccCoeKGw.o(.text+0x1a3): In function `main': : undefined reference to `glutDisplayFunc' /tmp/ccCoeKGw.o(.text+0x1a8): In function `main': : undefined reference to `glutMainLoop' /tmp/ccCoeKGw.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status
Kann irgendjemand was damit anfangen... Habe alles genau durchgeschaut, und sehe leider keine Syntaxfehler... ☹
lg xecto