Skip to content

C++: How to cross-compile from Windows to Linux?

I have a C++ module on windows which I want to compile such that I get a dynamic library for linux *.so.

Does a cross-compiler exist that can help me out?



Several comments mentioned using Windows Subsystem for Linux. I would personally recommend this as it is far easier than trying to use a cross-compiler. It also comes with the added benefit that you can test your code in the same environment in which you compile it. is a great resource for getting started with WSL.

4 People found this is helpful