I am interested in cross-compiling Windows applications using GL, GLU, and GLUT using Gentoo. It appears that GL and GLU are in there, and files 'libglut.a' and 'libglut32.a' exist in /opt/xmingw/i386-mingw32msvc/lib, and they do contain GLUT symbols, suffixed by '@' and a number (I'm assuming that's an artifact of Win32's DLL ordinals but I don't know the details thereof). However, where's the glut.h include file? Attempting to use /usr/include/GL/glut.h results in a number of problems so I'm (a) curious as to what I'm doing wrong, and (b) whether this is a bug somewhere else. Mingw does work for generating simple "hello-world"-type stuff. Reproducible: Always Steps to Reproduce: 1. emerge xmingw-binutils, xmingw-runtime, xmingw-w32api, and xmingw-gcc, in that order (mostly so that I can have a c++ variant of ming). 2. Filch glutdino.c from http://www.opengl.org/resources/code/glut/glut_examples/examples/glutdino.c (it's as good a test case as any for cross-compiling OpenGL stuff) 3. The obvious method to build it would be something like /opt/xmingw/bin/i386-mingw32msvc-gcc glutdino.c -lglut32 -lglut -lglu32 -lopengl32 -lgdi32 but that blows up because of the missing #include file. I've tried variants of this build line but none have worked so far. Actual Results: glutdino.c:12:21: GL/glut.h: No such file or directory glutdino.c:19: error: parse error before "angle" glutdino.c:19: warning: data definition has no type or storage class glutdino.c:22: error: parse error before "bodyWidth" ... Expected Results: Well, assuming I've got the libraries correct it should have produced an a.exe file. (If I do not, one will get undefined symbol warnings, and hopefully then I can work out what libraries to add in that case.) $ emerge info Portage 2.0.50-r8 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.4.26-gentoo-r3) ================================================================= System uname: 2.4.26-gentoo-r3 i686 AMD Athlon(TM) XP 1600+ Gentoo Base System version 1.4.16 distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -mcpu=athlon-xp -march=i686 -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/lib/jboss /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=athlon-xp -march=i686 -pipe" DISTDIR="/data/distfiles" FEATURES="autoaddcvs buildpkg ccache distcc sandbox" GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j3" PKGDIR="/usr/portage_packages.aurigae" PORTAGE_TMPDIR="/data/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow X aalib acpi acpi4linux alsa apm arts avi berkdb cdr crypt cups encode esd foomaticdb gdbm ggi gif gnome gnomedb gpm gtk gtk2 guile imlib ipv6 java jpeg kde libg++ libwww mad mikmod mmx motif mozilla mpeg nas ncurses nls oggvorbis opengl oss pam pdflib perl png postgres ppds python qt quicktime readline sdl slang spell ssl tcltk tcpd tetex truetype video_cards_fglrx video_cards_radeon x86 xml2 xmms xv zlib"
Looks like the include files are incompleate then. Could you try using the Linux ones instead, I think they are cross platform compatable. ( add -I/usr/include to the gcc line)
Created attachment 35324 [details] various attempts at cross-compiling a simple OpenGL application cd into a clean directory, untar this attachment, then ./testrun
This is an upstream bug, contact www.mingw.org Cannot fix here. ( ask the mingw for this feature )