Freyja
Freyja

Reputation: 40784

Cross-compiling Windows applications from Eclipse in Ubuntu Linux?

I am trying to set up a programming environment to compile Windows executables and libraries from Ubuntu Linux. I have installed MinGW (from the official Ubuntu repositories) and it is working great from the command line; however, I try to use it from within Eclipse, and it neither detects it automatically nor can I seem to find a way to make it work manually.

So, my question is, how can I set up Eclipse to cross-compile Windows applications, preferably using MinGW (although other, alternative solutions are welcome too)?

Upvotes: 7

Views: 6406

Answers (2)

psihodelia
psihodelia

Reputation: 30492

Eclipse requires appropriate executables in your PATH variable. Find where is your MinGW GCC compiler called gcc and then just add its path into your Windows PATH variable. If you want POSIX applications development using Eclipse, please consider Cygwin instead of MinGW.

Upvotes: -2

Max
Max

Reputation: 2907

I used Eclipse Indigo (3.7) with CDT package on MacOSX to cross-compile Windows apps and it works fine. Just for a reference to others interested, I installed mingw with port install i386-mingw32-gcc -universal. In CDT, create new C or C++ project, on the next page of the wizard, select Project Type as "Cross-Compile Project", toolchain - "Cross GCC". On the next page, type Tool Command Prefix (I have i386-mingw32-) and provide a path to mingw tools.

Complete the wizard, add your files and build!

Cheers, Max

Upvotes: 7

Related Questions