I have a C++ dynamic library which defines global symbols - functions. When I compile the library using gcc those symbols are by default visible. It may leads to symbol collisions when an application links to a few libraries. I can put functions in the namespace and hide private functions using the compilation flag -fvisibility=hidden
. Then API functions should contain the following attribute: __attribute__ ((visibility ("default")))
Let's assume that I compile a dynamic library on Windows using Microsoft Visual Studio compiler.
Some symbols are not defined with __declspec(dllexport)
Does it mean that those symbols will be hidden ?