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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:33:26+00:00 2026-06-16T17:33:26+00:00

I have mostly worked in Windows, and recently I started working in Linux. I

  • 0

I have mostly worked in Windows, and recently I started working in Linux. I have a doubt. I have used Visual Studio as IDE in Windows and used Makefile in Linux.

There are two types of libraries in Windows (VC++), static library (.lib) and DLL. It is quite obvious (isn’t it?) if I link with lib file I am using static linking else dynamic linking.

Now when I use g++ compiler, why I need to explicitly mention -Bstatic/-static or Bdynamic/-dynamic flags. Because if file is .a file then I must be using static -linking and if file is .so I am using dynamic linking.

  • 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-16T17:33:27+00:00Added an answer on June 16, 2026 at 5:33 pm

    There are times when you want to “force” the compiler to do what it normally wouldn’t. In particularly -static is useful when you are building against a library that may not be installed [or not have the same version installed] on another machine where you want your code to run.

    the -Bdynamic is useful if you want to have ONE library linked statically, but not EVERY library that your code uses.

    e.g. gcc -o myprog myprog.o -Wl,-Bstatic -lspecial -Wl,-Bdynamic
    will link myprog using static linking for libspecial (which may be something that isn’t widely distributed, for example something you have built yourself)

    For general, local development, you don’t need either.

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

Sidebar

Related Questions

I have recently just started working with Lucene (specifically, Lucene.Net) and have successfully created
I'm using Visual Studio 2010. I work with mostly windows services and web services.
I have mostly worked with ASP.NET WebForms and more recently MVC. I am now
I have recently started using VirtualBox to get my Linux environment rather than fully
I've mostly worked in MVC1. I'm now working with some MVC2 code. I have
friends I am new to iphone development, I have mostly worked with Android, now
I am reading about EJB Session Bean. I have worked mostly on spring and
I have this thing working mostly. What I don't get is, if I have
I mostly use Eclipse but have mentionned Netbeans on my cv. Are there any
Mostly I have worked with GWT so PHP for me is still new. I

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.