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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:42:51+00:00 2026-05-19T04:42:51+00:00

In my application I have 3 major parts: Exe : an executable file Lib_A

  • 0

In my application I have 3 major parts:

  • Exe : an executable file
  • Lib_A : a library contains a singleton class and a base class for some calculations to be use in singleton
    class
  • Lib_B : a library contains a number of classes derived from the base in Lib_A

The reason that I have the derived classes in Lib_B is, I would like to compile the Lib_B at runtime from Exe. I need to generate derived classes during the calculations without terminating the whole system. This is too important for me. That means initially I may have say Lib_B1 dynamically loaded, also I may compile other versions of Lib_B as Lib_B2, Lib_B3, Lib_B4 etc. and load them dynamically too. All Lib_Bx libraries will have entry point functions to export the classes in them.

So taking the following facts into account :

  • At runtime there will be various number of files sharing the same Lib_A.
  • The application must run in Windows and Linux. So partial cross-platformness is an issue.
  • I am going to use some libraries like TBB, Boost, Qt which may have their own libraries like tbb.dll etc.

What are the pros and cons of statically or dynamically linking of Lib_A against both Exe and Lib_Bx’s? How can perfomance, size of system etc. be affected? Are there any dangerous or difficult situations I may encouter besides for each OS I need to use the same compiler for Exe, Lib_A and Lib_Bx’s.

The design of the whole system is a very hard problem for me, so any comments will be appreciated.

Thanks very 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-19T04:42:51+00:00Added an answer on May 19, 2026 at 4:42 am

    From what I understand of your project description, you should link Lib_A dynamically : if you link Lib_A statically to each of your Lib_Bx shared libraries, you will duplicate x times the Lib_A code and static variables.

    Say, if you have a class in Lib_A, that have the form :

    class BaseKlass
    {
      static int instance_count;
      ...
    };
    

    instance_count will be duplicated in all your shared libraries, thus make it impossible for BaseKlass to count its instances.

    You could possibly be bitten by more subtle problems with virtual tables, or RTTI (dynamic_cast), etc.

    You should have a look at this boost.python document that describes problems related to what I mentionned.

    Boost.python allows to create python modules (dynamic libraries) that are to be loaded in the same process. Each python module created with boost.python, if they are to communicate together at the c++ level such as deriving a class B in a module from a class A in another module, is supposed to link dynamically with boost.python lib to avoid problems.

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

Sidebar

Related Questions

I used pole display(E POS) in my POS c# application.I have two major problem
Do the major web application frameworks (Rails, Django, etc) have libraries that provide functionality
We have a Hibernate/Spring application that have the following Spring beans: <bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager
In my application I have a Customer class and an Address class. The Customer
I have a major problem. We have a asp.net application that has this report
I have an game application I have written for Windows Mobile and I want
In my application I have TextBox in a FormView bound to a LinqDataSource like
In my application I have a DataGridView control that displays data for the selected
In my application I have a window which I popup with small messages on
In my current application I have a form that requires the user to enter

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.