This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

RE: link problem


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


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