Subject: RE: link problem
From: [email-masked] (Colin Peters)

13 Oct 1998 10:00:05 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
To: "vsevolod mick tonkonoh" <[email-masked]>
Cc: "GNU-win32" <[email-masked]>

vsevolod mick tonkonoh <[email-masked]> 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
"[email-masked]" with one line of text: "help".