I am using Xcode to develop for Mac OS X. I have created a dynamic library, and I want to specify that the symbols not be exported, unless I specifically mark them to be. As I understand it, I need to set the
-fvisibility=hidden
flag when I compile, and then use:
__attribute__((visibility(
"default")
))
when I declare the function, to make it exported.
I am having difficulty, however, setting the -fvisibility=hidden flag when using Xcode. I have set it in 'Other C' and 'Other C++' fields in the project settings, but all of my functions still seem to be exported. (I am using nm -gm CarbonLibrary.dylib to verify this)
What am I doing wrong?
Start Free Trial