I learned recently that on Linux, all symbols of a library are exported by default, but on Windows, none are. It seems that for every symbol of a library you care about, you must do __declspec(dllexport)
and pair it with a __declspec(dllimport)
on the receiving end.
Doing this for every symbol sounds like a chore, and bloats the code, and hurts readability. Is it possible to just enable all symbols by default?
I have read Export all symbols when creating a DLL, but all of the answers there seem extremely laborious and hacky. I would like a linker flag or something of the sort, if it exists. The linked post was from over 10 years ago, so maybe things have improved since then?