Operating System - HP-UX
1748275 Members
3786 Online
108761 Solutions
New Discussion юеВ

Re: compilation failure on itanium with error #2393

 
Isabel Lin_1
New Member

compilation failure on itanium with error #2393

I am getting a compilation error "error #2393: pointer to incomplete class type is not allowed " on HP B.11.23 ia64 using aCC A.06.00.
The same source code compiled successfully on HP B.11.00(PA-RISC) using aCC A.03.55 as well as on other UNIX platforms. Can someone point me to what that "error #2393" means?

Isabel Lin
===============================================
"/home/ilin/src/sjc/sjcunixdepot/main/agent/NqClassLib/include/NqClassLib/NqRef.h", line 326: error #2393:
pointer to incomplete class type is not allowed
if ((m_pData != NULL) && (m_pData->decRef() == 0)) {

detected during:
instantiation of "void NqRef::TRef::cleanUp() [with
Data=UAConfig::Config]" at line 246
instantiation of
"NqRef::TRef::~TRef() [with Data=UAConfig::Config]"
at line 661 of "../ua_job.h"
4 REPLIES 4
Ganesh SG
New Member

Re: compilation failure on itanium with error #2393

Pointers can be declared for a forward declaration; is is possible that m_pData is one such. For such pointers, it is not possible to dereference it (with say, . or ->). That might be the problem. However, since the program compiled fine with 3.55, it might because of a compiler defect with the 3.55 compiler or the 6.00 compiler.

Can you send me the preprocessed file? (use -E -.i instead of -c in your makefile). If it is small, you can post it here; otherwise you can send it to me at sgganesh@india.hp.com.

-Ganesh
Eric Antunes
Honored Contributor

Re: compilation failure on itanium with error #2393

Hi Isabel,

Check this thread: http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=180241

There's also some other threads about samba.

Best Regards,

Eric Antunes
Each and every day is a good day to learn.
Ganesh SG
New Member

Re: compilation failure on itanium with error #2393

No its not he issue with C Vs C++ as pointed out in the other thread. Even in C, it is not possible to deference with a forward declaration. For example, with this, a C compiler would complain:

struct nlist *np;
printf("np->name : %s :: np->defw : %s\n", np->name, np->defw);

The compiler would have no clue on what name and defw are with just a pointer, with definition of struct nlist not seen in the same translation unit.

-Ganesh
Isabel Lin_1
New Member

Re: compilation failure on itanium with error #2393

I've resolved the problem. In my class definition, one object method had parameter default value defined for a template class. That caused a compile time template instantiation and aCC 00.06.00 compiler on HP IA64 requires the template class definition to be complete. Removing the default parameter value resolved the issue.