I know why and when __declspec(dllimport)
and __declspec(dllexport)
are used in Visual C++.
I know the GCC alternative to both __declspec(dllimport)
and __declspec(dllexport)
is __attribute__((visibility("default")))
.
I'm just wondering why Visual C++ does need both commands, while GCC is able to figure out itself whether it should import or export the symbol?
Of course the easy answer is: "It's a design choice of GNU/Microsoft", maybe it's the only answer. Thank you for your input!