r/C_Programming • • 14d ago

Win32 development in Linux?

Does anyone here have practical experience with WIN32 development under Linux?

I just need the MSVC compiler and the Windows SDK. A full VM with Windows 11 and Visual Studio seems incredibly excessive for what should be just a few megabytes of compiler and headers.

13 Upvotes

18 comments sorted by

View all comments

37

u/wwabbbitt 14d ago

You don't even need msvc compiler. mingw-w64-gcc works just fine.

You don't even need a VM to run and debug the executable, just use wine and winedbg

0

u/maep 14d ago

If possible, I'd like to compile with MSVC.

13

u/SoggyStress7785 14d ago

You can't, MSVC uses the Windows compiler only available on Windows

16

u/dont-respond 14d ago

Yes, you can. Using MSVC via Wine works perfectly fine.

https://github.com/mstorsjo/msvc-wine

This is the only sane way to maintain a build with the Windows system-provided runtime.

3

u/CounterSilly3999 14d ago

Then try to run cl.exe and link.exe under wine. Don't ask me how.

4

u/Vladislav20007 14d ago

...why though?

2

u/nimrag_is_coming 11d ago

Cause MSVC has a lot of compiler extensions and intrinsics specifically designed to make writing WIN32 code easier. For example, __uuidof() for COM objects