Advertisement

06.08.2008 at 10:38AM PDT, ID: 23467422
[x]
Attachment Details

How do I hide symbols in my dynamic library by default when using Xcode

Asked by JohnGaby in General Macintosh Programming, Apple Programming, Editors IDEs

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
[+][-]06.10.2008 at 03:35PM PDT, ID: 21755657

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.10.2008 at 04:36PM PDT, ID: 21755880

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2008 at 05:07PM PDT, ID: 21755976

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2008 at 06:41PM PDT, ID: 21756246

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: General Macintosh Programming, Apple Programming, Editors IDEs
Sign Up Now!
Solution Provided By: JohnGaby
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628