Is there a Linux equivalent of __declspec(dllexport) notation for explicitly exporting a function from a shared library? For some reason with the toolchain I’m using, functions that aren’t class members don’t appear in the resulting shared library file.
Is there a Linux equivalent of __declspec(dllexport) notation for explicitly exporting a function from
Share
And there is no equivalent of
__declspec(dllimport)to my knowledge.Typical usage is to define a symbol like
MY_LIB_PUBLICconditionally define it as eitherEXPORTorIMPORT, based on if the library is currently being compiled or not:To use this, you mark your functions and classes like this: