Linking problems
Hi all,
More compiliation problems I'm afraid: I'm trying to get this
simple program to compile. It produces an object file OK, but ld
complains:
cannot open -lMesaGL: no such file or directory.
This is confusing, given I have mesage-dev installed, and libMesaGL.a is
next to libMesaGLU.a in the directory, which ld seems to find fine.
Mystified is,
Matthew
-Makefile
hello: helloworld.c
gcc helloworld.c -o hello -I/usr/lib/glib/include -I/usr/include/GL \
-L/usr/lib -lglut -lMesaGLU -L/usr/X11R6/lib -lXmu -lX11 -lMesaGl
-helloworld.c
#include <stdio.h>
#include <GL/glut.h>
void display(void)
{
glClear( GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 1.0, 0.0);
glBegin(GL_POLYGON);
glVertex3f(2.0, 4.0, 0.0);
glVertex3f(8.0, 4.0, 0.0);
glVertex3f(8.0, 6.0, 0.0);
glVertex3f(2.0, 6.0, 0.0);
glEnd();
glFlush();
}
int main(int argc, char **argv)
{
printf("hello world\n");
glutInit(&argc, argv);
glutInitDisplayMode ( GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(100,100);
glutInitWindowSize(300,300);
glutCreateWindow ("square");
glClearColor(0.0, 0.0, 0.0, 0.0); // black background
glMatrixMode(GL_PROJECTION); // setup viewing projection
glLoadIdentity(); // start with identity matrix
glOrtho(0.0, 10.0, 0.0, 10.0, -1.0, 1.0); // setup a 10x10x2 viewing world
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
--
Elen sila lumenn' omentielvo
Steward of the Cambridge Tolkien Society
Selwyn College Computer Support
http://www.cam.ac.uk/CambUniv/Societies/tolkien/
http://pick.sel.cam.ac.uk/
Debian GNU/Hurd - love at first byte
Reply to: