Languages and Scripting

Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

 
SOLVED
Go to solution
Neel2
Regular Advisor

Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi,

While building C++ program on HP-UX B.11.23 U ia64, using aCC 06.15 compiler version. I got the following errors:

"/usr/include/machine/sys/_types.h", line 65: error #20: identifier "__fpreg"
is undefined
__fpreg __for_alignment_only_do_not_use;
^

"/usr/include/stdio.h", line 130: error #20: identifier "__va_list__" is
undefined
typedef __va_list__ __va_list;
^

"/usr/include/stdio.h", line 543: error #20: identifier "__va_list__" is
undefined
typedef __va_list__ va_list;
^

"/usr/include/stdlib.h", line 574: error #20: identifier "__float80" is
undefined
extern char *_extecvt(__float80, int, int *, int *);
^

"/usr/include/stdlib.h", line 574: error #18: expected a ")"
extern char *_extecvt(__float80, int, int *, int *);
^

"/usr/include/stdlib.h", line 575: error #18: expected a ")"
extern char *_extfcvt(__float80, int, int *, int *);
^

"/vobs/cxx/h.cih/cxxcls/typedef.h", line 57: catastrophic error #5: could not
open source file "new.h"
#include
^

Any suggestions would be appreciated.

Thanks,
Neel
61 REPLIES 61
Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

You are NOT using aCC6. The error messages are close but not correct.
Compile with -v and provide that output.

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Yes, we are compiling using third party front end compiler. And we got the support from them and resolve the issue. Secondly, using the same compiler we create a cpp file, and we compiled with aCC6.

And we got the following error:
//=========================================
"fund.cxx", line 11142: error #3449: explicit specialization of member
"PClassObject::pco_State [with X=PObject]" must precede its first
use (at line 47 of "/vobs/cxx/h.cih/cxxcls/template/pclass.h")
PClassObject< PObject >::pco_State = {

//==========================================

Command line:
aCC -c -D_REENTRANT -mt -g0 +DD32 +Z -I/...
/cxx/fund/fund.cxx

I tried to use "+inst_implicit_include" compile time flag to resolve the error, but not use.

fund.cxx file snippet with line no.
11139 template <>
11140 void PClassObject< PObject >::vpp_delete(void *XXX) { delete(::PObject *)XXX; }
11141 template<> PClass
11142 PClassObject< PObject >::pco_State = {
11143 (void*) 0, /* next */
11144 "PObject", /* shortName */
11145 "", /* longName */
11146 "", /* idName */
11147 (o_object *)0, /* o_clsobj */
11148 sizeof(::PObject), /* inst_size */
11149 (void *)0, /* initVal */
11150 (void *)0, /* offset */
11151 0L, /* class number */
11152 (struct PWSlot *)PObject___Wslots,
11153 (struct PLSlot *)PObject___Lslots,
11154 (struct PVSlot *)PObject___Vslots,
11155 (struct PMSlot *)PObject___Mslots,
11156 (struct PSuperOffset *)PObject___supers,
11157 0x248be37b, /* signature */
11158 0x54637281, /* magic */
11159 (void *)0,
11160 PClassObject< ::PObject >::vpp_delete,
11161 ::PObject::_V_class_layout,
11162 ::PObject::_V_activate,
11163 0, /* aList == 0 */
11164 ::PObject::get_PObject,
11165 0, /* next_slot */
11166 0, /* tSize */
11167 0, /* wSize */
11168 (struct PTSlot *)0, /* tCopy */
11169 (struct PWSlot *)0, /* wCopy */
11170 0, /* pc_flags */
11171 0, /* activate */
11172 0, /* deactivate */
11173 0 /* init */
11174 };


And the header file pclass.h file snippet:

37 template
38 class PClassObject {
39 public:
40 static PClass& Object() { return pco_State; }
41 static PClass* Pointer() { return &pco_State; }
42
43 // we add the following function so that customer can have
44 // a workaround for the bug in Sun C++ 3.0
45
46 static PClass& get_Object() { return pco_State; }
47 static PClass* get_Pointer() { return &pco_State; }
48
49 static VPP_IMPORT_PCLASS PClass pco_State; // inter
nal use only
50 static VPP_IMPORT_PCLASS PClassWakeup pcwo_Object; // inter
nal use only
51 static void vpp_delete(void*);
52 };


Will appreciate your quick reply on the above discussed issue.

Thanks in advance for the response.
Neel.


Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

>we are compiling using third party front end compiler.

No wonder it looked almost the same.

"fund.cxx", line 11142: error #3449: explicit specialization of member "PClassObject::pco_State [with X=PObject]" must precede its first use (line 47 of "pclass.h")
PClassObject< PObject >::pco_State = {

This is saying that you need to move the explicit specialization of pco_State before its first use. Or you need to move it before the definition of PClassObject

>I tried to use "+inst_implicit_include" compile time flag to resolve the error, but not use.

This is an obsolete cfront template coding style option, you shouldn't use it.

>fund.cxx file snippet with line no.
>And the header file pclass.h file snippet:

What is the relative ordering of these in the .i file?

>Will appreciate your quick reply on the above discussed issue.

I'm probably going to need a .i file from this source, if it isn't obvious how to reorder things.

You can look at how aC++ does it by looking at the explicit specializations in <string>:
// basic_string<...>::__nullref
#if !defined(_RWSTD_NO_STATIC_DEF3) && !defined(_HP_INSTANTIATE_IN_LIB)
template <>
const basic_string, allocator >::_C_null_ref_type basic_string, allocator >::__nullref;

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

Thanks for the reply. I will try to change, and if I find any difficulty will send you a.i file.

Thanks,
Neel.
Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

Please find attached .i file for reference.

Best regards,
Neel
Dennis Handly
Acclaimed Contributor

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

#line 125 "/vobs/cxx/h.cih/cxxcls/typedef.h"
template < class X > class PClassObject;
Declared, page 74.

#line 37 "/vobs/cxx/h.cih/cxxcls/template/pclass.h"
template < class X >
class PClassObject {
static PClass pco_State;
Defined, page 127

#line 10942 "fund.cxx"
...
PClassObject< PObject >::pco_State = {
Defined, this is roughly on page 202.

You are going to have to move all of your explicit specializations in func.cxx after the include for pclass.h.

Neel2
Regular Advisor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

Hi Dennis,

Could you please show me a small example, which will help me to understand How to move explicit specialization after pclass in fund.cxx file.

Thanks,
Neel
Dennis Handly
Acclaimed Contributor

Re: Using aCC 06.15 compiler veersion => Identifier "__fpreg" is undefined

>Could you please show me a small example, which will help me to understand how to move explicit specialization after pclass in fund.cxx file.

The small example was in for basic_string::__nullref that I mentioned above.

template <class x>
class PClassObject {
static PClass pco_State;
...
};

template <>
PClassObject::pco_State = { ... };

Basically the explicit specialization for the template class static data member pco_State must be right after the definition of the template class PClassObject.
(Or it must be before its first use.)

You have several other explicit specializations of pco_State that will also need to be moved up.

Dennis Handly
Acclaimed Contributor
Solution

Re: Using aC++ A.06.15 compiler version => Identifier "__fpreg" is undefined

Ok, I fiddled with your .i file and looked at the Standard. You just need to put explicit specialization forwards after the definition of class PClassObject:

// Add explicit specialization forwards
class PObject;
class PVirtual;
class PBiLinkVstr;
class VAssociate;
class Container;
class VString;
class PBiLink;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;
template <>
PClass PClassObject::pco_State;