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.