Export shared libraries in cross-platform form?

Is there a cross-platform way to selectively export certain functions and structures from a C project that creates a shared library?

I want to make sure that a specific build system is not required (visibility must be defined in the code, for example, as a macro), and in a way that both GCC and MSVC can understand.

Thanks.

+3
source share
1 answer

Strictly not, of course, because toolchains do not match.

. , , DLL __declspec(dllexport) , __declspec(dllimport) , . C , , , , . , .

Unix , . , , . , / , , , . , "mapfile" "Solaris" GNU linker --version- script (-M solaris) , , .

, , / . , , , , , . (, Qt, Glib/Gtk +, msys ..) .

+4

Source: https://habr.com/ru/post/1719433/


All Articles