Compile the file in linux and run in windows

I am starting to learn c and C ++ programming, and I am writing it on Linux.

Is it possible to create a binary file with g ++ and run it as exe in window 7? or do I need to compile the code again in windows?

+3
source share
1 answer

You can use the mingw cross-compiler to create Windows binaries on Linux. In Ubuntu (and, I think, other Debian variants) the package is called mingw32. Then you have a cross compiler called i586-mingw32msvc-g++(or similar). To create simple command-line programs without dependencies between libraries, this solution is OK.

, MXE (M cross environment). MXE - , , .

, OpenSCAD ( 3D CAD, Qt ) MXE Windows. . - OpenSCAD .

+5

All Articles