Operating System - OpenVMS
1820012 Members
3522 Online
109608 Solutions
New Discussion юеВ

C++ problem with %CXX-E-INCOMPLETETYP

 
SOLVED
Go to solution
ptrskg
Frequent Advisor

C++ problem with %CXX-E-INCOMPLETETYP

Hi,

I'm fairly new to C++ and have problem with the code below, I get an error saying %CXX-E-INCOMPLETETYP when I compile. The complete error message follows at the end.

The compiler version says "HP C++ V7.2-018 on OpenVMS IA64 V8.3-1H1" and the command is $cxx prefs.cpp/def=(__USE_STD_IOSTREAM).

The code compiles OK in "Visual Studio" and on Linux.

My problem seems to bee that I'm trying to refer my own class in the member map m_Groups. Can this be a restriction in the compiler or have I missed anything here? Can this construction be made otherwise to work with the OpenVMS c++ compiler?

Thanks for any help.

Peter

prefs.cpp

#include "prefs.h"

Prefs::Prefs()
{
}

Prefs::Prefs(const string &name, const string &value)
{
   AddSimpleValue(name, value);
}

Prefs::~Prefs()
{
   m_Values.clear();
   m_Groups.clear();
}

void Prefs::AddSimpleValue(const string &name, const string &value)
{
   pair<ValueMap::iterator,bool> rc;
   m_Values.insert(ValuePair(name, value));
}

 prefs.h

#ifndef PREFS_H
#define PREFS_H

#include <string>
#include <map>

using namespace std;

class Prefs
{
   typedef map <string, string> ValueMap;
   typedef pair<string, string> ValuePair;
   typedef map <string, Prefs> GroupMap;
   typedef pair<string, Prefs> GroupPair;

   public:
      Prefs();
      Prefs(const string &name, const string &value);
      virtual ~Prefs();

   private:
      void AddSimpleValue(const string &name, const string &value);

      ValueMap m_Values;
      ValueMap::iterator m_ValueItr;

      GroupMap m_Groups;
      GroupMap::iterator m_GroupItr;
};

#endif

 Error message

    second_type second;
................^
%CXX-E-INCOMPLETETYP, incomplete type is not allowed
          detected during:
            instantiation of class "std::pair<_TypeT, _TypeU> [with
                      _TypeT=const std::string, _TypeU=Prefs]" at line 117 of
                      "SYS$COMMON:[SYSLIB]CXXL$ANSI_DEF.TLB;1(RW_INTERNAL_TREE.
                      H)"
            instantiation of class "__rw::__rw_rb_tree_node<_Alloc, _Val,
                      _Key, _KeyOf> [with _Alloc=std::map<std::string, Prefs,
                      std::less<std::string>, std::allocator<std::pair<const
                      std::string, Prefs>>>::allocator_type,
                      _Val=std::map<std::string, Prefs,
                      std::less<std::string>, std::allocator<std::pair<const
                      std::string, Prefs>>>::value_type,
                      _Key=std::map<std::string, Prefs,
                      std::less<std::string>, std::allocator<std::pair<const
                      std::string, Prefs>>>::key_type,
                      _KeyOf=__rw::__select1st<std::map<std::string, Prefs,
                      std::less<std::string>, std::allocator<std::pair<const
                      std::string, Prefs>>>::value_type, std::map<std::string,
                      Prefs, std::less<std::string>,
                      std::allocator<std::pair<const std::string,
                      Prefs>>>::key_type>]" at line 292 of
                      "SYS$COMMON:[SYSLIB]CXXL$ANSI_DEF.TLB;1(RW_INTERNAL_TREE.
                      H)"
            instantiation of class "__rw::__rb_tree<_Key, _Val, _KeyOf, _Comp,
                      _Alloc> [with _Key=std::map<std::string, Prefs,
                      std::less<std::string>, std::allocator<std::pair<const
                      std::string, Prefs>>>::key_type,
                      _Val=std::map<std::string, Prefs,
                      std::less<std::string>, std::allocator<std::pair<const
                      std::string, Prefs>>>::value_type,
                      _KeyOf=__rw::__select1st<std::map<std::string, Prefs,
                      std::less<std::string>, std::allocator<std::pair<const
                      std::string, Prefs>>>::value_type, std::map<std::string,
                      Prefs, std::less<std::string>,
                      std::allocator<std::pair<const std::string,
                      Prefs>>>::key_type>, _Comp=std::map<std::string, Prefs,
                      std::less<std::string>, std::allocator<std::pair<const
                      std::string, Prefs>>>::key_compare,
                      _Alloc=std::map<std::string, Prefs,
                      std::less<std::string>, std::allocator<std::pair<const
                      std::string, Prefs>>>::allocator_type]" at line 120 of
                      "SYS$COMMON:[SYSLIB]CXXL$ANSI_DEF.TLB;1(MAP.)"
            instantiation of class "std::map<_Key, _TypeT, _Compare,
                      _Allocator> [with _Key=std::string, _TypeT=Prefs,
                      _Compare=std::less<std::string>,
                      _Allocator=std::allocator<std::pair<const std::string,
                      Prefs>>]" at line 27 of "SPPUSR_ROOT:[PSK]prefs.h;31"
at line number 85 in module RW_INTERNAL_PAIR.H of text library SYS$COMMON:[SYSLIB]CXXL$ANS
I_DEF.TLB;1

%CXX-I-MESSAGE, 1 error detected in the compilation of "SPPUSR_ROOT:[PSK]prefs.cpp;11".

 

10 REPLIES 10
Jansen_8
Regular Advisor

Re: C++ problem with %CXX-E-INCOMPLETETYP

I smell a BUG.

 

I compiled it with HP C++ V7.3-009 for OpenVMS Alpha V8.4 and found no problems. I do not have a Itanium to test.)

 

Is the 7.2 the latest compiler for Itanium? if not maybe an upgrade helps.

 

 

                              Jouk

x2084
Trusted Contributor

Re: C++ problem with %CXX-E-INCOMPLETETYP

Updating may change this,  but whether there is a bug or not depends on how the map template should be implemented in STL. It's not a compiler bug. The type definition and use of  GroupMap is within the definition of Prefs, hence Prefs is incomplete.

Steven Schweda
Honored Contributor

Re: C++ problem with %CXX-E-INCOMPLETETYP

   Looks about the same here, with:

IT $ cxx /version
HP C++ V7.3-023 on OpenVMS IA64 V8.3-1H1

so at least one compiler upgrade may not help much.  No such complaint
from:

alp $ cxx /ver
HP C++ V7.3-009 for OpenVMS Alpha V8.3   

   Generally speaking, when a compiler complains about a system header
file, ("at line number 85 in module RW_INTERNAL_PAIR.H of text library
SYS$COMMON:[SYSLIB]CXXL$ANSI_DEF.TLB;1"), one is tempted to blame the
folks who supplied the compiler.

Hoff
Honored Contributor

Re: C++ problem with %CXX-E-INCOMPLETETYP

FWIW and based on various published statements from HP, the HP C++ compiler for OpenVMS I64 is based on the Intel C++ compiler on Itanium. 

 

Regardless, contact the HP support center, and see what they think about this error and about this header.

 

Dennis Handly
Acclaimed Contributor

Re: C++ problem with %CXX-E-INCOMPLETETYP

>Can this construct be made otherwise to work with the OpenVMS c++ compiler?

 

You could use a pointer to that container.

 

>the HP C++ compiler for OpenVMS I64 is based on the Intel C++ compiler on Itanium.

 

But the important part is that it is EDG and RW based.

 

This fails on HP-UX with aCC6 with the same error.  But works fine under g++.

So this an illegal program that just depends on the quality of implementation of the STL.

(I suppose it could be that g++ doesn't do error checking of the point of instantiation correctly.)

ptrskg
Frequent Advisor

Re: C++ problem with %CXX-E-INCOMPLETETYP

Thanks all for the answers.

 

I've just installed HP C++ V7.4-003 and tested but with the same bad result so I will report this to HP. Hopefully they will fix it and until then I go for a pointer solution.

But it's strange that it works on the Alpha....

 

Thanks again

Peter

ptrskg
Frequent Advisor
Solution

Re: C++ problem with %CXX-E-INCOMPLETETYP

Hi,

I have been in contact with HP support and they answered with returning mail that this is a known problem and they supplied me with a fix that seems to work.

So, I close this case and thanks once again.

Peter

Steven Schweda
Honored Contributor

Re: C++ problem with %CXX-E-INCOMPLETETYP


[...] they supplied me with a fix that seems to work. [...]

   Describe "a fix"?  New header file(s)?  New compiler?  Something super-secret?

ptrskg
Frequent Advisor

Re: C++ problem with %CXX-E-INCOMPLETETYP


@Steven Schweda wrote:

   Describe "a fix"?  New header file(s)?  New compiler?  Something super-secret?


HP sent me a new CXXL$ANSI_DEF.TLB but I don't know which h-files they have changed.

 

Hoff
Honored Contributor

Re: C++ problem with %CXX-E-INCOMPLETETYP

Pull the files and diff'm, if you're interested in changes.  Between this libxext procedure and this directory-differences tool, you should have the tools that deal with everything you need here to differences the old and the new libraries.

 

And FWIW, the typical (modern) approach when dealing with HP OpenVMS or other Enterprise software is to contact the vendor's support center directly, and get the updates.   (When you have support, obviously.)  HP clearly prefers this approach, and (when the initial basic Google search that is an inherent part of researching most any problem turns up nothing) this direct-to-support approach is (usually) the fastest approach to get your issues resolved or your servers back online.   Asking questions in forums (if Google turns up nothing) (usually) just delays the resolution.  Somebody (like me) will usually just tell you "call HP", and you can cut to the chase yourself.

 

What's also involved and somewhat more subtle, HP also uses these reports to prioritize and generate and push out kits with fixes.  The more times a bug is reported, the more likely that the fix will be a patch.  (Shipping out isolated files is comparatively problematic; folks can make mistakes with the installations (copying the file to the SYS$SPECIFIC directory, for instance), and there's no integrated tracking of hand-installed images.)