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 8204021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:45:40+00:00 2026-06-07T07:45:40+00:00

I am new to building static libraries and would like to create 2(+) libraries

  • 0

I am new to building static libraries and would like to create 2(+) libraries each of which has some unique code and some shared code. My intention is that other projects will link one or more of these static libraries.

Util.h/m  <-- Shared
ImplOne.h/m  <-- Unique to 'ImplOne'
ImplTwo.h/m  <-- Unique to 'ImplTwo'

I am using XCode and generating the libraries by building Util.m and ImplOne.m in one case, and Util.m and ImplTwo.m in the other.

Of course the issue is that I now cannot use these libraries together because they will have duplicate symbols. What is a better architecture for this situation?

  • 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-07T07:45:41+00:00Added an answer on June 7, 2026 at 7:45 am

    I think the cleanest alternative would be to make a separate library for the shared Utils.h/m. The drawbacks are that your users would need to link utils along with implone and/or impltwo, and that in order to link impoone and impltwo together both libraries need to be compiled with the same version of utils. In return, the source of the libraries would stay nice and clean.

    An alternative would be to use macros to alter function and variable names in the utils to avoid linker errors. The most important consequence of this is code duplication: both implone and impltwo would link identical pieces of code under different names. The other one is readability: it would suffer tremendously, because each reference to a function in utils would need to be wrapped in a macro. This makes the second approach dirty, so I would definitely recommend making utils a separate library.

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

Sidebar

Related Questions

Say I'm building a UDF class called StaticLookupUDF that has to load some static
I'm building a new web app that has a requirement to generate an internal
I have a workspace with a project which links with the static libraries in
I am building a Language class for internationalization, and I would like to access
I'm considering building a new web app with totally with static html, js, css
I am building a new site which will consist of a mix of dynamic
I'm building up a new database in SQL Server 2008 for some reporting, and
my code is:- class Building{} class Barn extends Building{ public static void main(String[]args){ Building
Building a django app with some mostly static pages at the front of the
I'm developing a project that includes multiple static libraries. The way in which I

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.