Operating System - HP-UX
1833323 Members
3307 Online
110051 Solutions
New Discussion

Re: STL in shared library problem

 
Max V. Zinal
New Member

STL in shared library problem

Hello,

I wrote a portion of code that looked like that:
-------------------------------
#include
#include

int someproc()
{
map theMap;
theMap.insert(map::value_type("str1", "str2");
// somecode
}
-------------------------------

Of course, this is not an actual code. This test that has been written to verify the problem.

The problem is that it works fine in an executable, but coredumps/overflows a stack/etc etc etc in a shared library.
The 'coredump statement' is the destructor of map object.

I've created an executable with command:
aCC +DAportable -o test test.C
and shared library with
aCC +DAportable +z -b -lstd -lstream -o test.sl test_sh.C

What was wrong? Please help.

Best regards,
Max V. Zinal
1 REPLY 1
satyach
Advisor

Re: STL in shared library problem

try with static library version.

while linking use following option
-Wl,-a,archive

shared library having some side effectes.