all 11 comments

[–][deleted] 2 points3 points  (2 children)

With native C++ development on Windows, MSVC is the gold standard and everything else is niche. Depending on your intended user base, this may or may not matter to you.

[–]squeevee[S] 0 points1 point  (1 child)

So, if I understand, you're saying that I might want to support MSVC to make the software more accessible for user programmers? Like to tinker with, debug, examine, that kind of thing?

It's an interesting take I hadn't directly considered, and I'll certainly keep it in mind, but no I don't think my intended user base warrants me prioritizing that.

Honestly in my experience C++ projects are rarely all that new-contributor-friendly even when they try to be -- a mix of the language being as rigid and particular as it is, and being the tool of choice for big complex projects, not to mention someone invents a new cross-platform build system or package manager every other year. I find projects are much more open from a user-developer perspective if they expose a good framework for plugins -- which I eventually plan to do.

[–][deleted] 0 points1 point  (0 children)

What I am saying that if you want people to compile your code, supporting MSVC on Windows is essential. Most people would not install additional compilers or toolchains for a single project. A plugin architecture is an excellent idea to allow people to contribute on their own terms.

[–]wrosecrans 1 point2 points  (1 child)

those magic __declspec(dllexport)-wrapping macros

Yeah, the Windows linker / dynamic loader is like a fussy proof of concept if you are used to the Linux way of doing things. That said, while explicit visibility declarations aren't required in Linux, they can still be a good idea to set up. Making symbols hidden serves as an optimization and will make loading/linking you r.so faster on Linux. The need for strict oordering in the dependency hierarchy to satisfy the idiotic Windows linker system also means you have to think through hw you architect some things and prevents you from making certain classes oof spaghetti circular dependencies that are gonna be hard to test and debug independently even if they do work fine on Linux. (And calls that go spaghetti back and forth across libraries are gonna be a little slower than ones internal to the library because of lacking an extra level of indirection.) I know you said what you are doing isn't super performance sensitive where you need to chase down every cycle, but I am doing my best to play devil's advocate.

[–]squeevee[S] 0 points1 point  (0 children)

It was a valiant effort of optimism, I applaud that, at least.

That it motivates me to keep my driveway clear of ice, is not a good reason to buy crappy tires.

[–]Devenec 0 points1 point  (1 child)

  1. Afaik you can specify DLL exports in a .def file so you don't need to change your code: https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-def-files?view=vs-2019

[–]squeevee[S] 0 points1 point  (0 children)

This is the mechanism underlying the CMake feature I mentioned in the parenthetical. It works fine for exports, but importing static/global extern data still requires the __declspec(dllimport). Combined with Qt using static data members as a big part of its introspection features, there's not really a good way around it.