[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Templates & shared libs



Hi everyone,

I have very strange problem with templates and shared
libraries. Here is my situation:

- create small test class that is template and uses
std::basic_string<char> internally
- compile it and link it into the shared library
- create small test program that uses test template
class and link it with the shared library

When I run test program I consistently get
“Segmentation fault” on basic_string initialization.
Now here is the kicker. If I make the test class
non-templated and leave it in the shared lib, or leave
it as a template but not use shared lib and link it
directly with the program, everything works ok. 

Just to mention that all code and all tests work fine
on the redhat platform.

I would appreciate any help on this one.

Thanks,

Boris


__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/