Recommended Posts

I''m attempting to get OpenGL running on an OpenBSD system, and I''m running into a problem. I''m just trying to compile a very simple example program from NeHe, and I''m getting lots of errors like this:
/tmp/ccc25811.o: Undefined symbol `_glutInit'' referenced from text segment
glutInit is a function call that is defined in glut.h, and I would assume is implemented in the shared library libglut.so.3.7, which I have.
I''m using the following compile command:
gcc -Wall -o try try.c -I/usr/X11R6/include/ -I/usr/local/include/ -L/usr/local/lib/libglut.so.3.7 -L/usr/X11R6/lib/libGLU.so.1.3 -L/usr/X11R6/lib/libGL.so.1.2 -L/usr/X11R6/lib/libGLw.a
Help?

0

Share this post

Link to post

Share on other sites

It may help to toss your compile statement into a Makefile. This is an example makefile I used for a project last year in Unix/Linux. I don''t know how much you know about makefiles, but this worked for me. It should work, provided your link and include directories are correct. Let me know if it works, I usually develop using MSV C++ but want to start writing demos in linux again. Its just the best way to go...

Share this post

Link to post

Share on other sites

Thanks! It did work. The problem was that I was trying to specifty the entire library with the -L flag. I needed instead to specify the library path with -L and the actual library with -l. I''m not really a C programmer, so I''m unfamiliar with these compiler flags. In the end, if you use a compile command like: