Re: OpenGL
Re: OpenGL
- Subject: Re: OpenGL
- From: "Joseph R. Kiniry" <email@hidden>
- Date: Sun, 19 Jan 2003 11:45:49 +0100
--On zaterdag, 18 januari 2003 22:01 -0800
email@hidden wrote:
Message: 8
Date: Sun, 19 Jan 2003 11:01:02 +1030
Subject: OpenGL
From: Steven <email@hidden>
To: email@hidden
Hi All
I am having trouble getting OpenGL programs to compile.
I have been using the following command:
g++ -I/usr/X11R6/include test.cc
and got link errors for the following:
Id; Undefined symbols
_glLoadIdentity
_glMatrixMode
_glViewport
_gluPerspective
I also tried
g++ -I/usr/X11R6/include -L/usr/X11R6/lib test.cc
And I got the same error!!
Please Help someone!
Steve
Hi Steve,
Don't forget that, in general these days, any libraries beyond the standard
C library (libc) and the standard math library (libm) must be explicitly
mentioned when you compile/link. In your case, you need the OpenGL library
(libGL) and the GLU front end library (libGLU). Thus, your command line
should read:
g++ -I/usr/X11R6/include -L/usr/X11R6/lib test.cc -lGLU -lGL
Note that for some compilers, the order in which you specify include paths
(-I), library paths (-L), and libraries (-l) is important. In fact, in
some situations where there are cyclic library dependencies you end up
having to specify the same library twice; e.g.,
gcc foo.c -llib1 -llib2 -llib1
Finally, one should note that you are likely compiling an application that
also uses one or more X toolkits, not just OpenGL. It is likely you'll
need to append a -lX11 or similar to the end of your command line to
indicate the toolkit(s) against which you wish to link.
Best,
Joe Kiniry
---
Joseph R. Kiniry http://www.kindsoftware.com/
KindSoftware, LLC ID 78860581 ICQ 4344804
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe: http://www.lists.apple.com/mailman/listinfo/x11-users
Do not post admin requests to the list. They will be ignored.