tags:

views:

388

answers:

4

hello...

please tel me what is the difference between

  1. MinGW cross compiler and
  2. GCC Cross compiler.

which is used in which Operating System?? i'm very much in confusion...

I need to create ".exe" in Linux Operating system using QT, hence tel me which is the cross compiler to be used. Please do reply.

A: 

GCC is usually used in Linux.. MinGW is just a windows port of GCC to compile to exe.

Jreeter
+1  A: 

MinGW is basically a port of GCC and related tools, allowing them to run natively on windows machines.

Cross compiling is the act of using a compiler on one operating system/architecture to generate a bin/exe/dll/object that is compatible with another operating system/architecture. Basically, you ask the compiler to generate assembly and startup routines for something other than the host os's default.

IF you were on a linux machine, you'd use gcc to compile it for the linux machine... if you were on a windows machine, you'd use MinGW, but with flags to tell it to compile for the linux machine's specs.

Ape-inago
+2  A: 

MingW32 is a port of GCC with "win32 target".

There are two architecture in a cross-compiler: host and target. The host is the platform the compiler run on; the target is what the result code will run.

Assume you are using Ubuntu, you can see the package here.

J-16 SDiZ
actually, you can even have a 3rd architecture, by building a cross compiler (canadian cross) that is built on a machine different from the one that it later on runs on: http://en.wikipedia.org/wiki/Cross_compile
none
+4  A: 

MinGW is a GCC cross compiler for Windows environments. (There are multiple GCC cross compilers for various different targets.)

To compile windows executables on your Linux box, you want a MinGW install for your distribution of Linux.

If you're running

Stobor
i'm using OpenSuSE distro of Linux
suse
it would be nice if u send me the link to get MinGW for OpenSuSE distro of Linux.
suse
Good Answer. I've been building my MinGW based program on Windows. The next version I'll start cross compiling and this info will come in handy. Thanks.
Mark Beckwith