What's the most painless way to compile and distribute a plugin binary on Windows? In particular, which compiler and which linking options create less issues?
- Visual Studio with dynamically linked vcruntime and ucrt. Some plugins do this and then ask the users to install vcredist themselves. I'm not thrilled about the possibility that a user without vcredist installed discards my plugin before even trying it.
- Visual Studio with statically linked vcruntime and ucrt. For applications, Microsoft discourages this stuff, but given that file descriptors, heap buffers, and other resources stay private to the DLL code, I guess it should be fine?
- Visual Studio with statically linked vcruntime and dynamically linked ucrt. Seems like a reasonable thing given that all Windows 10+ users are supposed to have ucrt. Does not have a dedicated flag like just /MT or just /MD, but apparently Microsoft is somewhat approving of this option and call it "hybrid CRT". Do you see any issues with this?
- Mingw cross compiler in MSYS2. It seems possible to statically link to libgcc (or whatever it's called), libstdc++, etc and leave just ucrt linked dynamically (so, "hybrid CRT"). They promise "faster math support compared to VisualStudio's" which does appear somewhat true in my unoptimized code, but I don't know if that's true in general. Is there a good reason to use/not use Mingw? It does not produce PDB debug symbols meaning it's GDB for debugging, but it does appear to work (I can attach with gdb to a host and see debug symbols of the plugin), and between Visual Studio, WinDbg, and GDB, I'm not sure what's the lesser evil.
- More niche options like Clang with Microsoft headers and Microsoft linker. Or other stuff? Anything that's worth trying?
- Visual Studio with dynamically linked vcruntime and ucrt. Some plugins do this and then ask the users to install vcredist themselves. I'm not thrilled about the possibility that a user without vcredist installed discards my plugin before even trying it.
- Visual Studio with statically linked vcruntime and ucrt. For applications, Microsoft discourages this stuff, but given that file descriptors, heap buffers, and other resources stay private to the DLL code, I guess it should be fine?
- Visual Studio with statically linked vcruntime and dynamically linked ucrt. Seems like a reasonable thing given that all Windows 10+ users are supposed to have ucrt. Does not have a dedicated flag like just /MT or just /MD, but apparently Microsoft is somewhat approving of this option and call it "hybrid CRT". Do you see any issues with this?
- Mingw cross compiler in MSYS2. It seems possible to statically link to libgcc (or whatever it's called), libstdc++, etc and leave just ucrt linked dynamically (so, "hybrid CRT"). They promise "faster math support compared to VisualStudio's" which does appear somewhat true in my unoptimized code, but I don't know if that's true in general. Is there a good reason to use/not use Mingw? It does not produce PDB debug symbols meaning it's GDB for debugging, but it does appear to work (I can attach with gdb to a host and see debug symbols of the plugin), and between Visual Studio, WinDbg, and GDB, I'm not sure what's the lesser evil.
- More niche options like Clang with Microsoft headers and Microsoft linker. Or other stuff? Anything that's worth trying?
Statistics: Posted by Alien Brother — Fri Jul 12, 2024 2:00 pm — Replies 0 — Views 15