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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:55:39+00:00 2026-05-30T01:55:39+00:00

There is a free software project that builds some static c++ libs and then

  • 0

There is a free software project that builds some static c++ libs and then
links them to make a binary. I’d like to separate the libraries out as
.so files for dynamic linking (so other projects might make use of
the lib). One library builds just fine, but when I try to link
it, I get “undefined reference” errors.

Those are easy to track down and fix (the code referenced those
methods in a .h file but the corresponding .cc file was not
included in the Makefile compile command). I am, however,
wondering why, as a general matter, a library would link just
fine as a static library but not as a dynamic library. What are
g++ and ld doing in one case but not the other?

Thanks much.

  • 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-30T01:55:40+00:00Added an answer on May 30, 2026 at 1:55 am

    static libraries, created with ar are just a bunch of object files. ar is a very simple archiver. There are no dependencies resolved at link time, see the man page of ar.

    Shared objects on the other hand, or dynamic libraries as you call them are a very different beast. They implement the ELF binary format and have a complicated ruleset. They also have initializing code, and some dependencies are resolved at link time. See http://www.akkadia.org/drepper/dsohowto.pdf and http://www.akkadia.org/drepper/goodpractice.pdf for a deeper introduction.

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

Sidebar

Related Questions

I'd like to get some code editing for a free software project done during
I'm starting a software project that I'd ultimately like to release as free, open-source
Is there any free software tool or combination that allows me to identify the
Are there any free tools or software packages that offer functionality similar to MS
Does there exist a free Windows software program that will help you generate regular
Are there any free tools that implement evidence-based scheduling like Joel talks about ?
Is there any decent free project/task management software out there with tasks management? I
Is there any free installer allow user to seamlessly install a software that could
Is there a free software for creating windows help files for your program? I
Is there any free or commercial component written in .NET (no COM interop) that

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.