top of page

exe and dll sharing the same static libraries

  • Writer: algboost
    algboost
  • Apr 20, 2015
  • 1 min read

sharedStaicLib.png

exe and dll sharing the same static libraries

-- run into dependency hell if Algo-DLL expects a different version of the library

-- memory allocated by the app cannot be freed by a dll and vice versa, unless both use the very same runtime (dll)

c++ - Is it possible for multiple Dynamic Link Libraries

Game.exe -> Root.dll -> Child.dll

| |

| '-> Common.lib (contains __declspec(thread))

|

'-> Common.lib (contains __declspec(thread))

-- issue with reference counting objects

-- My solution was to initialize the DLL with my own memory handling routines, having all modules work withe the same heap.

When to use dynamic vs. static libraries

Link dll to static library and load it into an application linked against the same static library

My general comments

-- Singletons are useful here

-- Then two DLLs could accidentally have their own thread-local variables shared between different DLLs, Clearly that would be disastrous

- - RTTI: You may end up with multiple type_info objects for the same class if you link a single static library into multiple DLLs. If your program assumes that type_info is "singleton" data and uses &typeid() or type_info::before(), you may get undesirable and surprising results


 
 
 

Comments


Featured Posts
Check back soon
Once posts are published, you’ll see them here.
Recent Posts
Archive
Search By Tags
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page