Hi there.
We are having trouble using the STL set on Solaris 2.7 with the SC 5.0
compilers.
We are not able to create an STL set as a member data of one of our own
template classes. Listed below are:
* The contents of the C++ file
* The compiler commands and the error messages using both the
STLPort 4.0 from SGI and the RogueWave STL files that come with
the SC5.0 native compiler on Solaris 2.7.
If you can identify the problem and let us know what is wrong with what we
are doing, we would appreciate it.
Thanks a ton in advance.
/***************** BEGIN CODE *****************************/
#include <set>
using namespace std;
template <class T>
class MyTemplateClass
{
public :
MyTemplateClass() ;
//- Default constructor
~MyTemplateClass() { clear(); }
//- Destructor
void clear() ;
//- This function clears the entire set.
private :
set<T> theSet_ ;
//- my set
MyTemplateClass<T>::MyTemplateClass()
{
void MyTemplateClass<T>::clear()
{
theSet_.clear();
{
// This line compiles without error.
set<int> aSet;
// This line does not compile
MyTemplateClass<int> aTemplate;
return;
/********************** BEGIN COMPILER ERROR *************/
/** ERROR with using the STLPort 4.0 version from SGI ***/
Command:
CC -I/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5 -c temp.C
Error Messages:
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 55: Error: pointer is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>. /********************** END COMPILER ERROR *************/ /********************** BEGIN COMPILER ERROR *************/ /** ERROR with using the RogueWave STL files distributed with the native Command: CC -c temp.C Error Messages: "temp.C", line 15: Error: Type name expected instead of "MyTemplateClass1". /********************** END COMPILER ERROR *************/ -Raikanta +----------------------------------------------+--------------------------+
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 56: Error: const_pointer is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 57: Error: reference is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 58: Error: const_reference is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 59: Error: const_iterator is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 61: Error: const_reverse_iterator is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 62: Error: const_reverse_iterator is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 63: Error: size_type is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 64: Error: difference_type is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 65: Error: allocator_type is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 68: Error: The type "_STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>" is incomplete.
"temp.C", line 111: Where: While specializing "_STL::set<int>".
"temp.C", line 111: Where: Specialized in non-template code.
"temp.C", line 111: Error: Cannot assign _STL::set<int, _STL::less<int>, _STL::allocator<int>>* to _STL::set<int>*.
12 Error(s) detected.
/export/home/common/goma/developer/mjpanth/work_dir/cedge/common/source/Mis
"temp.C", line 13: Error: Type name expected instead of "MyTemplateClass1".
"temp.C", line 42: Where: While specializing "MyTemplateClass<int>".
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 55: Error: pointer is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 56: Error: const_pointer is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 57: Error: reference is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 58: Error: const_reference is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 59: Error: const_iterator is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 61: Error: const_reverse_iterator is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 62: Error: const_reverse_iterator is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 63: Error: size_type is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 64: Error: difference_type is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 65: Error: allocator_type is not a member of _STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
"/export/home/mjpanth/STL/SGI-STL/STLport-4.0/stlport/SC5/stl/_set.h", line 68: Error: The type "_STL::_Rb_tree<int, int, _STL::_Identity<int>, _STL::_Compare, _STL::_Alloc>" is incomplete.
"temp.C", line 21: Where: While specializing "_STL::set<int>".
"temp.C", line 21: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 42: Where: Specialized in non-template code.
12 Error(s) detected.
compiler - SC 5.0 on the Solaris 2.7 ***/
"temp.C", line 44: Where: While specializing "MyTemplateClass<int>".
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 112: Error: The type "__rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>" is incomplete.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 118: Error: reference is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 119: Error: const_reference is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 120: Error: iterator is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 121: Error: const_iterator is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 122: Error: size_type is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 123: Error: difference_type is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 124: Error: pointer is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 125: Error: const_pointer is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 126: Error: reverse_iterator is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
"/usr/local/SUNWspro/SC5.0/include/CC/./set", line 127: Error: const_reverse_iterator is not a member of __rwstd::__rb_tree<int, int, __rwstd::__ident<int, int>, std::Compare, std::Allocator>.
"temp.C", line 23: Where: While specializing "std::set<int>".
"temp.C", line 23: Where: Specialized in MyTemplateClass<int>.
"temp.C", line 44: Where: Specialized in non-template code.
12 Error(s) detected.
| Raikanta Sahu | phone: (505) 277-8332 |
| rs...@unm.edu | FAX : (505) 277-8235 |
+----------------------------------------------+--------------------------+
| Research Staff | 1601 Central Ave NE |
| Albuquerque High Performance Computing Center| University of New Mexico |
| University of New Mexico | Albuquerque, NM 87131 |
+----------------------------------------------+--------------------------+