Cross-compiling Windows applications from Eclipse to Ubuntu Linux?

I am trying to set up a programming environment to compile Windows executables and libraries from Ubuntu Linux. I installed MinGW (from the official Ubuntu repositories) and works fine from the command line; however, I am trying to use it from Eclipse and it does not detect it automatically, and I cannot find a way to make it work manually.

So my question is: how to configure Eclipse to cross-compile Windows applications, preferably using MinGW (although other alternative solutions are also welcome)?

+6
source share
2 answers

I used Eclipse Indigo (3.7) with the MacOSX CDT package to cross-compile Windows applications, and it works great. Just for reference to other interested, I installed mingw with port install i386-mingw32-gcc -universal . In the CDT, create a new C or C ++ project, on the next page of the wizard select "Project Type" as "Cross-compilation project", toolchain - "Cross GCC". On the next page, enter “Command Line Prefix” (I have i386-mingw32- ) and specify the path to the mingw tools.

Complete the wizard, add your files and create!

Cheers, Max

+6
source

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

-2
source

Source: https://habr.com/ru/post/892367/


All Articles