This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Can't make an OpenGL program
- From: "Claudio Bley" <bley at cs dot uni-magdeburg dot de>
- To: Bill Ramsay <RamsayW at attbi dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 5 Sep 2002 01:15:11 +0200
- Subject: Re: Can't make an OpenGL program
- References: <3D76894C.7080803@attbi.com>
>>>>> "Bill" == Bill Ramsay <RamsayW@attbi.com> writes:
Bill> I am new to both OpenGL and GCC, but not to C/C++. I am
Bill> including <GL/glut.h>, which is where it is supposed to be
Bill> (usr/include/GL under RH Linux 7.3) and apparently the file
Bill> is being found. But when I run make or just compile I get
Bill> an undefined reference for every method I'm trying to use in
Bill> glut.h.
Bill> The file looks fine and the methods are defined.
No, the functions are only declared in that header file, they are
defined in the appropriate library.
Bill> What am I doing wrong?
You forgot to link with the libglut library. Just specify -lglut as an
additional command line option to gcc.
HTH
Claudio