public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Can't make an OpenGL program
@ 2002-09-04 15:30 Bill Ramsay
  2002-09-04 16:15 ` Claudio Bley
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Ramsay @ 2002-09-04 15:30 UTC (permalink / raw)
  To: gcc-help

I am new to both OpenGL and GCC, but not to C/C++.    I am including 
<GL/glut.h>, which is where it
is supposed to be  (usr/include/GL under RH Linux 7.3) and apparently 
the file is being found.     But when
I run make or just compile I get an undefined reference for every method 
I'm trying to use in glut.h.

The file looks fine and the methods are defined.    

What am I doing wrong?

Bill

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Can't make an OpenGL program
  2002-09-04 15:30 Can't make an OpenGL program Bill Ramsay
@ 2002-09-04 16:15 ` Claudio Bley
  0 siblings, 0 replies; 2+ messages in thread
From: Claudio Bley @ 2002-09-04 16:15 UTC (permalink / raw)
  To: Bill Ramsay; +Cc: gcc-help

>>>>> "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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-04 23:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-04 15:30 Can't make an OpenGL program Bill Ramsay
2002-09-04 16:15 ` Claudio Bley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).