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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:40:37+00:00 2026-05-27T10:40:37+00:00

1. Are shared libraries and dynamic libraries the same exact thing? windows just labels

  • 0

1. Are shared libraries and dynamic libraries the same exact thing?
windows just labels them as .dll, and linux labels them as .so?

2. If a shared libarary has a ton of functions that a program uses, when are those functions loaded into memory?
At the start of the program? when the particular function is actually called?

3. If I make a library like this:

#ifndef SHARED_H
#define SHARED_H

#include <iostream>
#include <string>

namespace shared
{
  void Function1(void);
  void Function2(void);
  void Function3(void);
  void Function4(void);
  void Function5(void);
  void Function6(void);
  ...
  void Function99(void);
  void Function100(void);
  ...
}
//assume none of these functions call each other

#endif

and my client program only calls one of those functions, will their be performance decrease because of all the other extra functions not used?
Not worried about compilation time.. just the actual running time

4. Is question 3’s scenario different if I use a class:

#ifndef SHARED_H
#define SHARED_H

#include <iostream>
#include <string>

class Shared
{
  public:
  void Function1(void);
  void Function2(void);
  void Function3(void);
  void Function4(void);
  void Function5(void);
  void Function6(void);
  ...
  void Function99(void);
  void Function100(void);
  ...
  private:
  protected:
};
//assume none of these functions call each other

#endif

5. I’m use to making a lot of objects(.o files), and then linking them together to make my executable.
would it be better to turn all of my objects(which are usually classes) into a .so file AND THEN link them together?
I understand that the executable will rely on the .so file, unlike the first approach where the objects can just be deleted after compilation, but what is the recommendation on this?

6. I’m a bit in the dark about the difference between -fPIC and -fpic
I’ve heard that -fPIC will always work and -fpic is target-dependent.
What does target dependent mean? If the library is always going to be compiled and used on the same machine, am I safe to use -fpic?

some of these questions may be trivial, but I want to be certain
about the things I’ve read so far. I appreciate any and
all responses
*If relevant: using gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

  • 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-27T10:40:37+00:00Added an answer on May 27, 2026 at 10:40 am
    1. Under Win, dll's are dynamic linked libraries, meaning they get loaded separately in memory at run-time, unlike static linked libraries (lib's) that are embedded in your module during compilation.

    2. Under Win, before the program starts. If it can’t find a dll it needs, it will report an error message and exit. That’s unless you dynamically try to call functions and not actually link against the library, via LoadLibrary and GetProcAddress.

    3. No. The functions have a well-known place in memory when the library is loaded. There is only one jmp or call instruction per function call regardless of how many functions there are.

    4. Also no. Most probably those functions will be represented as non-member functions that take this as an extra parameter.

    5. The main reason would be re-usability. If you have a functionally independent module that contains multiple object files, you might as well group them together. That way you can re-use it more easily because you’d be linking to just one library instead of multiple object files.

    6. ???

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

Sidebar

Related Questions

I'm writing some code that uses dynamic shared libraries as plugins. My command line
When developing a C/C++ (=2?) plugin based framework with shared objects/dynamic libraries that need
Dynamic libraries are nice. The have embedded information in them that help the runtime
I am realtivly new to the concept of dynamic loading and shared libraries. While
I have some shared/dynamic libraries installed in a sandbox directory. I'm building some applications
When compiling shared libraries in gcc the -fPIC option compiles the code as position
I've got several programs that use shared libraries. Those shared libraries in turn use
Our main solution is the development code: shared libraries, services, UI projects, etc. The
We have a large amount of legacy C++ code in shared libraries that are
Can anyone tell me how to do runtime debugging on shared libraries? I need

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.