Cross compiling under Windows for Linux


 
Thread Tools Search this Thread
Top Forums Programming Cross compiling under Windows for Linux
# 1  
Old 06-08-2009
Cross compiling under Windows for Linux

I have two headless servers I am writing code for, and a Windows box networked with them.

I want to compile my code within an IDE on the Windows box (eclipse most likely) and run the compiled binarys on the Linux boxes.

Will this work?
Using Cygwin (or MinGW)?
Thoughts?

Cheers, Ian
# 2  
Old 06-08-2009
Only if you are using a cross-compiler...one that specifically supports creating an executable for the target x86 Linux box.
# 3  
Old 06-08-2009
And GCC under Cygwin is?
# 4  
Old 06-08-2009
The problem is not the compiler per se, but the linker. Googling for "windows linux cross compile", the first result is http://metamod-p.sourceforge.net/cro...for.linux.html
# 5  
Old 06-08-2009
To compile and link for linux, assuming a compiler capable of it, you'd need to have all the linux headers and all the linux libraries and objects. Which is halfway to having linux in its entirety.
# 6  
Old 06-08-2009
VMWare server / Virtualbox with a linux install would an easier way.

You could set up your source tree as a shared filesystem between windows and the VM and do your compile in the VM.
# 7  
Old 10-05-2009
Hi,

Resurrecting this old thread.

I am in a similiar situation, however, we already have a native compiler on linux that will build 32bit and 64bit linux cross compilers. Now we want to go a step further and be able to cross-compile on a Windows host. The native compiler is based on GCC 3.3.3 and built with GCC 3.3.3, while the cross-compilers are GCC 4.1.2 compliant. We have sysroots in place for 32bit and 64bit, and the native compiler, and link in the source codes for GCC and Binutils. My question is, if we the criteria above, is it really necessary for me to install the crosstool mentioned in the link regarding cross-compiler in cygwin? Would it be sufficient to build the native compiler with Cygwin GCC 3.3.3 and link in necessary rpms (which we extract of course) from the linux distros), and then with the native compiler build the cross-compilers?

I would like to do as little changes as possible in the code we already have. Right now we build everything with make, and the source codes and binaries from the linux distros (we only take what it necessary, so only the relevant rpms are stored) are in rpm format.. The native compiler is buillt in a similiar way, i.e. source code for binutils, gcc from the linux distro are available, in addition to a set of rpm binaries.

So I guess install cygwin, gcc 3.3.3, rpm tools, and gnu make?

Thanks in advance!
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Cross Compiling Issue of udev-151 for MIPS Little Endain Architecture

Hi All, I am trying to cross compile udev-151 for MIPS little endian architecture. I am configuring like this: ./configure --prefix=$PWD/sree --host=mips-linux-gnu configure: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then... (3 Replies)
Discussion started by: bsreeram
3 Replies

2. UNIX for Dummies Questions & Answers

Cross-compiling libiconv for uclinux

Hi everyone, I want to cross-compile libiconv for uclinux to create a static library. I use the following command : ./configure --enable-static --disable-shared --build=i686-pc-linux-gnu --host=nios2-unknown-linux-gnu --prefix=/home/captain/Programs/nios2-linux/uClinux-dist/staging/usr... (2 Replies)
Discussion started by: moganesh
2 Replies

3. UNIX for Dummies Questions & Answers

Cross complie linux make files onto a windows 7 machine using PGI Cygwin

Hello, I am very unfamiliar with linux/unix (don't even know the difference), but am trying to get some linux software to run on my Windows machine for my research. I have the makefiles for the software, and it is designed to be compiled in the PGI complier, which I also have. When i... (6 Replies)
Discussion started by: roba87
6 Replies

4. Linux

Help Cross compiling a kernel for an HP Jornada 728

Hello, I just bought an old Jornada 728 and, as you may know, it comes with Windows CE 3.0. I do not use Windows, so i wanted to create my own linux system for the Jornada. I know there are projects like Jlime, Familiar Linux, 720 Degrees, etc. But i want something based on the distribution i... (1 Reply)
Discussion started by: semash!
1 Replies
Login or Register to Ask a Question