10
Is MSVC worth it? (programming.dev)

I currently maintain a legacy C+ app that runs on x86/x86_64/armhf linux, all 4 android archs and x86/x86_64 windows.

The linux compilation phase takes 1m, whereas on windows (using MinGW) it takes 10m. It's not the end of the world, but would the MS compiler be faster? Better?

top 7 comments
sorted by: hot top controversial new old
[-] aard@kyu.de 23 points 9 months ago

From the perspective of the CI guy: Just cross compile from Linux.

You can get the Windows compilers for free - just CLI build tools are enough for your case. The setup can be a bit messy, though. Also, if it's a GCC only codebase so far there's a decent chance it has constructs which will not compile on MSVC. It will not necessarily be faster, though.

[-] 0x0@programming.dev 3 points 9 months ago

if it’s a GCC only codebase so far there’s a decent chance it has constructs which will not compile on MSVC

Yeah in recent experiments i thing i've hit that wall... next experiment: mingw on linux.

[-] mkwt@lemmy.world 10 points 9 months ago

MSVC is probably about the same as mingw. Compiling stuff on Windows is slower because compiling creates a lot of short lived processes, and process creation is a lot more expensive on Windows NT.

[-] coltorl@programming.dev 8 points 9 months ago

If you’re supporting windows anyway you should use their tooling. This isn’t controversial, MSVC is a good compiler supported by good developers. I find MSVC more reliable than MinGW on windows as well. I recommend maintaining a single CMake project so that you can switch between compilers and build tools.

[-] boo@lemmy.one 7 points 9 months ago

You could also cross compile for windows from linux, iirc there are mingw packages on linux.

[-] TootSweet@lemmy.world 5 points 9 months ago

Do consider that Microsoft is not your friend and may pull evil legal and pricing tricks that fuck you over down the road. For instance, something like what Unity tried to pull recently.

Hell will freeze over before GCC or MinGW tries to pull something like that. (And even if they tried, someone could fork GCC or MinGW to ensure a free version remains available.)

[-] Oisteink@feddit.nl 1 points 9 months ago* (last edited 9 months ago)

there’s a free trial and there’s the build tools that can run from the command line or vscode. Why not give it a try?
https://code.visualstudio.com/docs/cpp/config-msvc https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022

this post was submitted on 27 Sep 2023
10 points (85.7% liked)

Programming

16210 readers
2 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS