Skip to content
Advertisement

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?

Advertisement

Answer

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.

https://learn.microsoft.com/en-us/windows/wsl/about is a great resource for getting started with WSL.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement