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

  • SEARCH
  • Home
  • 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 9185849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:22:41+00:00 2026-06-17T19:22:41+00:00

So I have nested Static Libraries several times in the past but never quite

  • 0

So I have nested Static Libraries several times in the past but never quite like this and its causing a bit of an issue.

For now lets assume I have 3 static libraries, A, B, and C. And one project that uses them as follows.

A is a base library composed of commonly used Custom Views, Data structures, and Categories. B is a library linked with A that contains view controllers shared among several projects. C is another library linked with A that contains view controllers shared among several projects.

This particular project uses code from B and C. So the structure looks like this:

   A
  / \
 B   C
  \ /
Project

And since the way Xcode links static libraries basically merges them, B and C both have all of A’s symbols. So I’m getting the duplicate symbols linker error. How do I go about dealing with this? Do I need to weak link something? Or is there a particular flag I’m missing? Do I need to set up some type of dependency other thank linking binaries?

I’ve googled and search here and found lots of good information but nothing I’ve been able to twist into this particular situation.

Update on Thoughts

So let me ask this as it seems to be a possible solution after reading that Static Libraries while capable of being merged really shouldn’t be.

Rather than having 3 independent Static Libraries should I put them all in one project and merely have multiple static library targets? Not even using Target Dependencies, just A, AB, and AC, and ABC targets that include the proper files and headers for their target? This will no doubt be rather complicated for build settings and could make source distribution a bit complex, but it would solve my current problem and possible be the better way to handle things. Whatcha think?

  • 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-17T19:22:42+00:00Added an answer on June 17, 2026 at 7:22 pm

    It looks like you are not creating static libraries B and C correctly as you are including object files from static library A. This is incorrect. Instead make A, B and C contain only their own classes’s object files and bring them all together in the final link of the Project binary.

    • You will have to allow B to see A‘s header files in order to compile correctly.

    • You will have to allow C to see A‘s header files in order to compile correctly.

    • You will have to allow Project to see A‘s, B‘s and C‘s header files in order to compile correctly as well as A‘s, B‘s and C‘s library (.a) files in order to link correctly.

    I think that an Xcode Workspace will take care of all of the header/library search path settings for you, once you set-up the project dependencies correctly, but I could be wrong about that and you might have to set those paths up yourself.

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

Sidebar

Related Questions

I have a nested static class like: package a.b public class TopClass { public
I have a static nested class, which I would like to return via a
I have read several articles on when to use nested classes, but none that
I have nested iframes and I would like to use onload function for the
Is it possible to have nested set capabilities in this somewhat custom setup? Consider
I'm working on a navigation control. I have nested lists which creates this: What
how to implement inner outer classes in c# i have two nested classes like
I have a problem with a nested lambda function which cannot see a static
I have call an asynchronous function inside a nested loop like below var queue
This is the scenario: I have nested classes and need to serialize then in

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.