Help: Template Question using gcc 3.3.1

R

Ravin

Hi,

This issue is on Solaris 2.8 platform using gcc 3.3.1.

I have a shared object that builds successfully on Solaris 2.8
platform. However, any applications that use the shared object get
the following error

libmytest.so: undefined reference to `std::char_traits<unsigned
short>::assign(unsigned short&, unsigned short const&)'
libmytest.so: undefined reference to `std::char_traits<unsigned
short>::copy(unsigned short*, unsigned short const*, unsigned)'
libmytest.so: undefined reference to `std::char_traits<unsigned
short>::length(unsigned short const*)'
libmytest.so: undefined reference to `std::char_traits<unsigned
short>::move(unsigned short*, unsigned short const*, unsigned)'


Upon further inspection of my code, I heavily use an internal
templatized object in my classes. This may be the cause of the issue.
The typdef, declared in one of the header file is shown below:

typedef std::basic_string<unsigned short> InternalStr;


I even tried instantiating using the following statements in one of my
cpp files, which did not seem to help:

template class std::basic_string <unsigned short>;
template class std::char_traits<unsigned short>;

The DLL version of this code works fine in Windows platform. Any help
would be greatly appreciated,

Thank you,

Ravin
 

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,802
Messages
2,569,662
Members
45,433
Latest member
andrewartemow

Latest Threads

Top