title: Exporting template classes c++
body: <p><strong>The following is my scenario:</strong> 
  I have an executable along with multiple shared libraries(.dll or .so). Both the executable and the shared libraries(.dll or .so) uses a set of common libraries. Since they are common libraries I want to reduce the binary foot print of the shared libraries, in order to reduce the shared library's foot print I am exporting the contents of the common libraries from the executable and importing them in shared libraries(dll or .so). </p>
  
  <p><strong>Note</strong>: Though size of the foot print is not the only one among multiple reasons, for the time being we can stick with it being major reason.</p>
  
  <p><strong>Problem</strong>: 
  In the common libraries there are some inlined functions and some template classes. When I compile the executable and the shared libraries using performance optimization flags the inlined/ template classes are inlined both in executable and shared libraries. It will create problems if the inline definitions are modified and there are some shared libraries with different set of inline function definitions. </p>
  
  <p>How to solve this problem ?</p>
  
  <p>When I started thinking about this even the STL classes provided by the CRT are template classes. The similar problem exists even in their case. Have they solved this problem? What will happen if they modify the definition of std::vector ? Please help.</p>