This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can't make an OpenGL program


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]