Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8482619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:52:01+00:00 2026-06-10T19:52:01+00:00

Apple uses the following code in the header of all its framework classes. #if

  • 0

Apple uses the following code in the header of all its framework classes.

#if !defined(__COREFOUNDATION_CFARRAY__)
#define __COREFOUNDATION_CFARRAY__ 1
...
#endif

Is this a recommended approach for eliminating “duplicate symbol” linker errors, when designing classes or categories for framework use, or are these left over protection from the use of #include instead of #import in c?

Research into this has lead me to this article on include guard

NOTE: this question is not asking how to fix a duplicate symbol error, but instead asking if there is any way of preventing your own code from causing the problem if its included more than once in a project.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:52:02+00:00Added an answer on June 10, 2026 at 7:52 pm

    You’re right about the include guard – there’s probably some compatibility reason it’s not been removed from the source.

    However, this won’t really protect you against duplicate symbols much.

    For example,

    What if you have two third party library, each of which uses the SBJSON library (I had this happen to a colleague a few weeks ago).

    Each of the libraries was compiled seperately so, from their point of view, SBJSON was only included once. However, when I came to link my app I couldn’t because I had duplicate symbols.

    I had to solve this by manually removing the symbols from one of the .a library files (This link shows it’s quite a common problem!)

    EDIT : This link is a much clearer step by step solution to the problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I find out that Apple uses the following declaration in OSAtomic.h header: inline static
I have a Nancy JSON REST service that uses the following serialisation code... FormatterExtensions.AsJson(this.Response,
The following code works fine when selecting all checkboxes, however it uses the the
I have the following piece of code which uses the ALAssets library to store
I have the following code in my website: <link rel=apple-touch-icon href=http://website.com/images/apple-touch-icon.png /> When I
I have a jquery mobile page that uses the following code to hide a
Apple uses modal often in their documentation. Like dismissModalViewController in their titles of methods,
is device token changes each time when i opens my application? Apple server uses
In the Apple Docs, they say that NSDateFormatter uses the Unicode for spec. I've
I'm trying to mimic apple's navbar style, specially the CSS3 expanding searchfield. It uses

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.