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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:50:12+00:00 2026-06-07T19:50:12+00:00

I have: Application A Dynamic library D Static library S Where: A is linked

  • 0

I have:

  • Application A
  • Dynamic library D
  • Static library S

Where:

  • A is linked with static library S at compile time.
  • D is compiled without linking S, but uses its header files
  • A uses dlopen to load D at runtime.

Is it possible for D to use symbols defined in S when being run in A, without D being linked with S at its own compile-time? I.e. can D access symbols in the global namespace?

Other notes:
I need D and A to both be able to call functions from S.
I ideally don’t want to alter S.

I’ve tried this, and I get (when a symbol from S is used in D):

dyld: lazy symbol binding failed: Symbol not found: __Z14myFunctioni

I presume this could either be:

  1. The existing function ‘myFunction(int)’ is not available to the shared library (security?)
  2. The symbol name for this function has been name mangled in a different way (EDIT: tested with extern "C" and ruled this out).

Perhaps I need to compile with different settings, or I have to always link all of S into D? Also would the situation changed if S became a dynamic library itself?

Thankyou

  • 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-07T19:50:13+00:00Added an answer on June 7, 2026 at 7:50 pm

    External references in the library are resolved using the libraries in that library’s dependency list and any other libraries previously opened with the RTLD_GLOBAL flag. If the executable was linked with the flag “-rdynamic” (or, synonymously, “–export-dynamic”), then the global symbols in the executable will also be used to resolve references in a dynamically loaded library.

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

Sidebar

Related Questions

My application uses one big precompiled static library, and the linking stage takes a
In my C++ application I have a static library (libCOMMON.a) that links to boost
In my application I have a dynamic system, so I have to check if
I have an ASP.NET Dynamic Data application (using Entity Framework) in which I have
I have a war file which is a simple dynamic web application where I
I have created one dynamic button in my application and I call the following
I have a ASP.NET Web Forms application and I'm using some dynamic controls in
I have a CloudFront destro in front of my asp.net application, serving dynamic content.
In my web application, I have a dynamic query that returns huge data to
In my winform application, I have an arraylist containing a dynamic number of string

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.