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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:49:59+00:00 2026-05-13T08:49:59+00:00

Say I have a library libfoo.so.1 , which depends (according to ldd ) on

  • 0

Say I have a library libfoo.so.1, which depends (according to ldd) on libbar.so.1. However, libbar.so.1 is not available at the moment. My app needs to call a function in libfoo.so.1 which doesn’t require libbar.so.1 at all.

Is there a way to load libfoo.so.1, resolve the function symbol and then call it without having libbar.so.1 to satisfy the dependency? It’s a case of “I know what I’m doing, just let me do it already”. I tried the RTLD_LAZY flag, but it still tries to load the libbar.so.1 library before not loading the symbols.


EDIT

Here’s the exact situation.

We have 3 players:

  • libbar.so.1, a shared library located in a path not in LD_LIBRARY_PATH or ldconfig, and whose dependencies are all resolved
  • libfoo.so.1, a shared library located in a different directory than libbar, but which depends on libbar. At runtime, libfoo will know where to locate libbar.
  • App, a binary application which needs to load libfoo at some point during runtime.

App doesn’t know where to find libbar, but knows that libfoo knows. What I’m trying to accomplish is having an init function in libfoo which would simply change App‘s current working directory to where libbar is located to finally resolve all the dependencies and make everyone happy.

libfoo will eventually need to call stuff in libbar, just not in this init function. I don’t think creating a stub would work since the symbols would eventually need to resolve to the real functions.

  • 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-13T08:49:59+00:00Added an answer on May 13, 2026 at 8:49 am

    Well, variables are still resolved even with RTLD_LAZY, so in general you do need all the libraries to be linked. Seems like you should create a stub libbar.so.1 that has no functionality and can be found by the linker.

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

Sidebar

Related Questions

I have a managed class library (say mylib.dll) and a 3rd party managed app
Say, I have mylibrary.ml which provides wrappings to library.c and I want to bytecode-compile
Say I had a library called libfoo which contained a class, a few static
Say I have Test assembly (NUnit compliant) App.Test.dll and a library to be tested
i have situation in which i have some library projects, say DataProcessors,Lib2 , included
Let's say I have a Java app which uses a (static) int constant from
lets say I have a library object (node1) which i have instantiated twice (mc1
Let’s say I have a library, in which I added a few Console.WriteLine(..) statements
I have a library project which contains an abstract class, let's say ClassA .
I have a library class which contains two methods, say, Login() and NavigateToPage(). Now,

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.