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

[2676 byte] By [Dukina] at [2007-11-27 5:00:04]
# 1

The usual symptom when running into unsupported features in libCstd is failure to compile, not failure to link. Your problem might be due to what is described in the FAQ, but it also might be due to a compiler bug or an error in your program.

C++ 5.3 is obsolete, and little support is available for it. It would be best to upgrade the compiler to the current version, Sun Studio 11 (C++ 5.8), which is free.

If you can't do that, can you install the current patches for WS6u2? You can find all of the patches here:

http://developers.sun.com/sunstudio/downloads/patches/

Download and install them all, and see if that helps.

Another thing you can try is to get Studio 11, and compile your code using STLport. STLport is a more fully conforming version of the C++ Standard LIbrary. (STLport is not available for C++ 5.3.)

The results using the default libCstd and the optional STLport with C++ 5.8 will help point you to the source of your problem: a compiler bug in C++ 5.3, a limitation of libCstd, or an error in your code.

To provide any more specific help, I would need an actual test case that shows the problem.

clamage45a at 2007-7-12 10:16:33 > top of Java-index,Development Tools,Solaris and Linux Development Tools...