This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
RE: link problem
- To: "vsevolod mick tonkonoh" <vsevolod at jps dot net>
- Subject: RE: link problem
- From: "Colin Peters" <colin at fu dot is dot saga-u dot ac dot jp>
- Date: Tue, 13 Oct 1998 14:18:27 +0900
- Cc: "GNU-win32" <gnu-win32 at cygnus dot com>
vsevolod mick tonkonoh <vsevolod@jps.net> wrote:
>I have just installed Mingw32 ( I am new to gcc)
>and I tried to compile simple program using OpenGL
>library.As I understand, libopengl32.a is what I need for it. My program
consists of little main() with one call to glLoadIdentity().
>Here is the error message:
>
>gcc -o prog main.o -L. -lopengl32
>main.o(.text+0x18):main.cc: undefined reference to `glLoadIdentity(void)'
Which gl header files are you using or did you write the prototype for
glLoadIdentity yourself? One reason this may not work is that the functions
in the OpenGL use "standard call" and need to be prototyped with
__attribute__((stdcall)). Generally this is #defined as part of WINAPI or
STDCALL or, in the gl headers, APIENTRY. The prototype for glLoadIdentity
looks like this in the headers I have:
WINGDIAPI void APIENTRY glLoadIdentity (void);
Note that you need to include windows.h to get APIENTRY and WINGDIAPI
defined correctly.
Good luck,
Colin.
- Colin Peters - colin at fu.is.saga-u.ac.jp
- http://www.geocities.com/Tokyo/Towers/6162/index.html
- Go not to usenet for counsel, for it will say both
- 'yes' and 'no' and 'try another newsgroup'.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".