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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:38:37+00:00 2026-05-28T16:38:37+00:00

Say I have two static libraries that were not built by me and I

  • 0

Say I have two static libraries that were not built by me and I have no control over their contents.

Library 1 has functions:

A()
B()
C()

Library 2 has functions:

A()
D()
E()

Both need to be linked into a calling application but the naming conflict of A() throws errors.

Is there a way to say “Ignore A() from Library 1 when linking” in linux using gcc and ld.

  • 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-05-28T16:38:37+00:00Added an answer on May 28, 2026 at 4:38 pm

    There are a couple of methods that I know of:

    1. You could make a copy of the library which has the relevant symbol hidden, and link against the copy. You don’t need access to any of the source for the library code to do this: objcopy can do it with the --localize-symbol option. I describe how to do this with .o files in this answer to a similar question, but the same method works just as well with .a libraries.

    2. The --allow-multiple-definition option could be used. (If you’re linking via a gcc command, rather than with ld directly, you’ll need to specify the option as -Wl,--allow-multiple-definition.) This will cause the linker to stop caring about the multiple definition, and simply use the first one that it encounters instead – so you have to be careful what order the libraries appear in on the command line. The downside it that it’s a global option, so if you have other unexpected symbol clashes, it might quitely do the wrong thing instead of telling you about it.

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

Sidebar

Related Questions

Say I have two functions that expect ...rest parameters private function a(...myParams):void { trace(myParams.length);
Static variable has file scope. Say I have two following files: file1.h file1.cpp file2.h
Let's say we have these two classes: public class Base { public static int
Say I have two classes and have a requirement that the primary key property
I have an iPhone SDK project that is supposed to build a static library
I have two scenarios. Suppose I have 3 shared libraries that export C++ symbols,
Say I have two classes like this: class A{ private static Random random =
Let's say that I have two .Net applications running on a single machine. Both
Let just say that we have two classes, A and B . Here is
so let's say that I have a static variable, which is an array of

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.