This is the mail archive of the cygwin@sources.redhat.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: Compiling OpenGL applications


The GL/gl.h file was not writen with -mno-cygwin in mind. You could get 
arround the problem by editing /usr/include/GL/gl.h as follow:

find a block like the following near the head of the file:

--------------- SNIP ---------------
#if defined(__CYGWIN__)
# ifndef APIENTRY
#  define APIENTRY __attribute__ ((__stdcall__))
#  define GL_APIENTRY_DEFINED
# endif
/* define APIENTRY to null string if we aren't on Cygwin */
#else
# define APIENTRY
# define GL_APIENTRY_DEFINED
#endif
--------------- SNAP ---------------

and replace it with this:

--------------- SNIP ---------------
#if defined(__CYGWIN__)
# ifndef APIENTRY
#  define APIENTRY __attribute__ ((__stdcall__))
#  define GL_APIENTRY_DEFINED
# endif
/* define APIENTRY to null string if we aren't on Cygwin and it is not 
defined */
#else
# ifndef APIENTRY
#  define APIENTRY
#  define GL_APIENTRY_DEFINED
# endif
#endif
--------------- SNAP ---------------

This fix will be included in the next release of the package.

André Bleau, opengl package maintainer.

>I just managed to make the import library and compile some code which uses wgl
>but I still have some problems:
>
>When I try to compile with -mwindows I get:
>---------
>/usr/bin/ld: warning: cannot find entry symbol _WinMainCRTStartup; defaulting
>to 00401000
>---------
>
>Compiling with -mno-cygwin gives following errors:
>---------
>In file included from wgl.c:6:
>/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-5/../../../../include/GL/gl.h:44:
>warning: `APIENTRY' redefined
>/usr/include/w32api/windef.h:85: warning: this is the location of the previous
>definition
>---------
>and lots of something like this:
>---------
>/cygdrive/c/WINDOWS/TEMP/ccRyOrHc.o(.text+0x495):wgl.c: undefined reference to
>`glViewport'
>/cygdrive/c/WINDOWS/TEMP/ccRyOrHc.o(.text+0x4b7):wgl.c: undefined reference to
>`glMatrixMode'
>/cygdrive/c/WINDOWS/TEMP/ccRyOrHc.o(.text+0x4bf):wgl.c: undefined reference to
>`glLoadIdentity'
>/cygdrive/c/WINDOWS/TEMP/ccRyOrHc.o(.text+0x4f1):wgl.c: undefined reference to
>`gluPerspective'
>---------
>
>Without these switches everything works fine.
>


André Bleau, ing.

email: bleau at igb dot umontreal dot ca
(Fight SPAM: encode your email-address)


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


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