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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:35:38+00:00 2026-06-18T12:35:38+00:00

I have a C++ based project(many source files) compiled using gnu make via a

  • 0

I have a C++ based project(many source files) compiled using gnu make via a makefile.
I have an application which links a library, say mylib. Now mylib is owned by some other developer. I see 2 files present in the path where the library binaries are generated namely
libmylib.so (shared object) and libmylib.a (static library archive file)

My application makefile has below linker option to link the library mylib

LDFLAGS+=-l:mylib …

Question is what version of the library mylib would be linked in my application executable

Would the shared object libmylib.so or static version libmylib.a ?

How would it be decided, would there be any other makefile option to govern this?

  • 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-18T12:35:39+00:00Added an answer on June 18, 2026 at 12:35 pm

    By default on non embedded Linux, you’ll get dynamic linkage. If you want to change that, you can specify it in LDFLAGS;

    LDFLAGS+= -Wl,--Bstatic -lmylib -Wl,--Bdynamic
    

    (possibly quotes are required) This will switch to static for this lib only, then back to the default dynamic.

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

Sidebar

Related Questions

I have a UIviewcontroller in a navigation based project, to which i am pushing
I am doing a refactoring of my C++ project containing many source files. The
I have a C++ project in which I am using Microsoft XmlLite for parsing
Does anyone has any insight on organizing sqlalchemy based projects? I have many tables
We have a git based project with a friend and one master branch. He
I have developed a view based project in Xcode. It is successfully running in
I'm working on a larger Web based Project, that probably will have to handle
I have this WinForms project (based on this one , but modified for SharePoint
I have a unit test project based on UnitTest++. I usually put a breakpoint
I have UITableViewController (initiated by the Navigation-based app project template). I am overriding loadView

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.