Help: Template Question using gcc 3.3.1

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ravin

    Help: Template Question using gcc 3.3.1

    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_trai ts<unsigned
    short>::assign( unsigned short&, unsigned short const&)'
    libmytest.so: undefined reference to `std::char_trai ts<unsigned
    short>::copy(un signed short*, unsigned short const*, unsigned)'
    libmytest.so: undefined reference to `std::char_trai ts<unsigned
    short>::length( unsigned short const*)'
    libmytest.so: undefined reference to `std::char_trai ts<unsigned
    short>::move(un signed 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_stri ng<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_stri ng <unsigned short>;
    template class std::char_trait s<unsigned short>;

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

    Thank you,

    Ravin
Working...