Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
MXE: Windows cross-compile environment for Unix (mxe.cc)
115 points by blacksqr on July 26, 2016 | hide | past | favorite | 26 comments


Fedora has been doing this since 2008: https://fedoraproject.org/wiki/MinGW

Apparently there are now 222 cross-compiled Windows packages: https://admin.fedoraproject.org/pkgdb/packages/mingw-%2A/

(Disclaimer: I was involved with this project at the beginning, but I've not used it for a while)


This is potentially very useful. Especially because it comes "batteries included" by cross compiling some important cross-platform libraries.

My experience with C and C++ is that, as great as the differences between Windows and Unix APIs are, the real friction comes from the differences in compilers and toolchains.

There is much good to be said about Visual Studio. But if you are interested in cross-platform, it is probably a lot easier to maintain a single Unix-based build system as long as you have an easy way to test the products under Windows.


The problem with cross-compiling is that one always requires the complete set of libraries to target, which in the end at least for desktop and server systems is much more convenient to have a VM instance for it than a cross-compiler.


I did not see anywhere on http://mxe.cc that said it compiled Windows binaries?


You are right, the authors are carrying on the grand web tradition of making whole sites about how great "Foo" without ever saying what Foo is.

But it is difficult to imagine what is compiled by the MingGW toolchain other than Windows binaries.

Arguably the table entries "i686-w64-mingw32" and "x86_64-w64-mingw32" also explicitly name Windows, in a very cryptic, GNU-specific way.


If anyone wants to improve the website, open an issue on https://github.com/mxe/mxe or raise a pull against the gh-pages branch.


It's not very clear, but in Supported Toolchains, there is "Runtime: MinGW-w64."


Related, here is a one-click-install OS X to Linux cross compiler, based on musl libc and its Makefiles.

https://github.com/FiloSottile/homebrew-musl-cross

$ brew install FiloSottile/musl-cross/musl-cross


nice, I hope it gets merged into mainline :)


At first I thought this was about the research chemical designer drug that was very popular but recently completely disappeared due to a ban in china


Corporate WebSense agrees with you and blocks my access for that reason.


Has anyone looked at the screenshot section? Is that Windows 98 and a photo from a CRT screen? Looks like a pretty old page.


Wow. To be honest, that's what most "Windows screenshots" look like for non-Windows projects. For some reason people have an aversion to newer versions of Windows and Aero is usually disabled for screenshots. Similar thing is when people call GUI like here: http://i.stack.imgur.com/Qdbsi.png "windows native"


From the history page: 2007-06-12 – Project start

It's pretty cool seeing these long lived projects going from strength to strength


I am using MXE happily for a couple of years already (some projects I've cross-compiled are here: http://richelbilderbeek.nl/CppMxe.htm ). IMHO it is awesome! Before MXE, I had a Windows computer with the only purpose to compile my code on. Life is better now.


How is that better than just installing the MinGW cross-compiler (and setting PKG_CONFIG_PATH) on my own?


How are pthreads supported on Windows?


mingw-w64 comes with a pthreads implementation that works on top of the Windows API: https://github.com/mirror/mingw-w64/tree/master/mingw-w64-li...


Any similar projects aimed at compiling Linux binaries on non-Linux Unix? (Excluding qemu, etc.)

Some non-Linux Unix have Linux emulation and can translate a subset of Linux syscalls. Perhaps it could be in a chroot with all the needed Linux libraries and utils.

But I am curious if there have been existing projects aimed at this goal.


Now, if we could only get OSX C/C++ programs to compile/use libraries,frameworks on Linux... then we could have one build VM for them all.


If you're on Gentoo, sys-devel/crossdev is useful for creating cross-compilers.


I've used this 5 years ago, back when it was called mingw-cross-env - it worked great.


I use MXE to build libsoundio releases for Windows. It works wonderfully.


GNU Octave is using it for its windows binaries.


Um, you need screenshots for a cross-compiler? :)


Any excuse to show off that sweet Titanic98 wallpaper!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: