Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22113

Why does MSVC (Visual C++) need separate dllimport and dllexport attributes and gcc not?

$
0
0

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!


Viewing all articles
Browse latest Browse all 22113

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>