STL with shared library

S

S S

Hi

Are there some known issues using STL with shared library. Recently I
got some crash for which the reason I dont see any, and searching on
goolge shown some such issues with shared library.

If somebody can help ? Thanks in advance.

S
 
S

S S

Yes, there are, IIRC.  You need to look in the archives for the
discussions on the subject, I am certain you can find something of
interest.  I believe it mostly relates to the fact that some shared
objects (libraries) have their own heap and when objects that have their
own dynamic memory (like std::string or std::vector) are created inside
those libraries, the contents may not be readily accessible outside.  To
be entirely honest, I don't remember the exact problems, but I've run
into something like that a couple of times.

The bottom line is however that the issue is not really with STL but
with dynamic linking and having a heap in the shared library.

V

Thanks for the pointers. But that means, we can never use shared
library with STL ? After some searching I found that multiple memory
managers can not be together in case of shared libs. But even if I use
static library, we still have multiple memory managers ? So why static
libs do not have problems?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top