views:

507

answers:

3

Will I have to use the crosstool that cygwin provides to make the libX11.so, libGL.so, and libGLU.so libraries using their respective source code? Or do you know where I can find them compiled already for crosstool (I'm new to this cross compilation)?

Just for clarification: I'm on a windows 7 machine trying to get my application also to compile for linux systems by using cygwin's cross compilation. The application uses OpenGL. Thanks

A: 

Why do you want to use Cygwin?

There is instructions on the OpenGL Wiki about how to use OpenGL on Windows using MinGW.

MinGW use the same GNU tools that are available on Linux (GCC, GDB, GMAKE, etc.) but produce Windows native executables. So, you shouldn't have trouble compiling your source code on both platforms.

esavard
He's trying to cross-compile for a Linux target, on a Windows build system.
caf
I see. You suggest in your comment above to use a Linux VM. Why bother to cross compile then? He just have to recompile on Linux using gcc. Write once compile anywhere. ;)
esavard
Aye, exactly - I suggested using a VM because it avoids having to mess around with cross-compiling at all.
caf
A: 

To cross-compile for Linux you should install the needed development libs and headers on a linux box[1] and then copy /usr/lib and /usr/include your cygwin environment (e.g. /crosscompiler/linux/...). When you build the cross compiler in cygwin, tell it where those native linux headers and libs are so they'll be used when you compile your app.

[1] If you're looking to run on a wide variety of linux boxes make sure you pick an older linux distro (e.g. Red Hat 9) to ensure your app doesn't have dependencies on very new glibc, etc..

Nathan Kidd
A: 

I just ended up building on a native Linux machine.

Joel