I'm looking for a way to hide symbols in a static library built in Visual Studio. I've been able to do it in clang and gcc but I'm not sure if there's a way to do it in VS.
I am building a static library parentlib that needs to be built on Linux (using gcc), OSX (using clang), and Windows (using visual studio compiler). This library makes use of 3 other libraries: childliba, childlibb, childlibc.
I have an API for parentlib and I want only the symbols pertaining to the API to be exposed in the library. For example, if someone ran nm parentlib
they wouldn't see any of the symbols in childlib(abc)
The way I do this when building the library using clang/gcc is:
clang -exported-symbols-list <text_file_with_parentlib_api_symbols> ...
gcc --globalize-symbols=<text_file_with_parentlib_api_symbols> ...
Now any symbols that aren't listed in the text file aren't made global in the resultant library.
Is there a way to set up this type of symbol hiding in Visual Studio? I've looked around and asked multiple colleagues but no one seems to think it's possible.