Linking the binary using a class with user-defined type (template) V6.2 Up2
Hallo,
I am using the the following CC version:
CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-23 2005/10/14
We are porting some code to Solaris. I am using a template-based user type:
typedef vector<CMyClass *> CMyClassListType;
then a simple class
class CBatchClass
{
public:
....
private:
CMyClassListType Classes;
};
It's quite simple (there are just more similar cases). I can compile it but the linker prints some errors due to undefined symbols:
...
__rwstd::__rb_tree<std::basic_string><char,std::char_traits><cha r>,std::allocator<char> >,std::pair<const std::basic_string><char,std::char_traits><char>,std::allocator&l t;char> >,CThreadGroup*>,__rwstd::__select1st<std::pair><const std::basic_string><char,std::char_traits><char>,std::allocator&l t;char> >,CThreadGroup*>,std::basic_string<char,std::char_traits><char&g t;,std::allocator<char> > >,std::less<std::basic_string><char,std::char_traits><char> ;,std::allocator<char> > >,std::allocator<std::pair><const std::basic_string><char,std::char_traits><char>,std::allocator&l t;char> >,CThreadGroup*> > >::iterator __rwstd::__rb_tree<std::basic_string><char,std::char_traits><cha r>,std::allocator<char> >,std::pair<const std::basic_string><char,std::char_traits><char>,std::allocator&l t;char> >,CThreadGroup*>,__rwstd::__select1st<std::pair><const std::basic_string><char,std::char_traits><char>,std::allocator&l t;char> >,CThreadGroup*>,std::basic_string<char,std::char_traits><char&g t;,std::allocator<char>
...
I found that the probably cause is the C++ incompatibility of the standard STL implementation shipped with Sun Studio:
http://www.nd.edu/~hpcc/solaris_opt/SUNWspro.forte6u2/SUNWspro/WS6U2/lib/locale /C/html/mr/READMEs/c++_faq.html#h1
Hmm. Is that really the right reason? I've tried some tricks with "-instances" option but without success. How shall I correct this? The Sun people write:
>>You have to write explicit conversions in your source code as a workaround.<<
I've tried to rewrite the type definitions to
typedef vector<void *> CMyClassListType;
but even the native types are unresolved! Can anybody provide me with the information how to solve it without upgrading the Sun CC? Thank you very much.
Best regards
D. Kutnik

