Operating System - HP-UX
1827825 Members
1988 Online
109969 Solutions
New Discussion

Problem with 3.31 aCC compiler

 
Prisco Antonietta
New Member

Problem with 3.31 aCC compiler

Hi,

we compiled our application with the 3.31 aCC compiler (in HP-UX11 env.) and we obtained the following two errors:


1)
+ /opt/aCC/bin/aCC -g +Z -DhpUXaCC11Platform +DAportable -DSABER -D_REENTRANT -D_HPUX_SOURCE -D_POSIX_SOURCE -D_THREAD_SAFE -DRWSTD_MULTI_THREAD -DRW_MULTI_THREAD -DEOS_TRACING -I/sw_common/osp5.3_EarlyDrop/osp/5.3/hpux11/include -I/sw_common/osp5.3_EarlyDrop/osp/5.3/hpux11/include/ClientOMR -I/sw_common/osp5.3_EarlyDrop/rpg/5.3/hpux11/include/ApplAccessMgr -I/sw_common/osp5.3_EarlyDrop/rpg/5.3/hpux11/include/abCommon/Gen -I../../include -I/opt/aCC/include -I/opt/aCC/include/iostream -I/usr/include -I- -I/sw_common/osp5.3_EarlyDrop/osp/5.3/hpux11/include -I../../include -c /oss/EOS/EOS410/eos4.10.08/eos_patch/EOS/src/libEosBuMibBase/EosBuMibBase/eosBuDomainBasePkg.C
...skipping forward
make: warning: don't know how to make /oss/EOS/EOS410/eos4.10.08/build/src/libEosAttr/gen/AttrParams.C : /oss/EOS/EOS410/eos4.10.08/eos_patch/EOS/src/libEosAttr/attrInfo.C : /opt/aCC/include/assert.h : include/assert.h

We had no problem compiling the same source code with 3.13 aCC compiler. We noted that assert.h files in 3.31 and in 3.13 are different.
In attachment there are the two version of assert.h file.

2)
+ /opt/aCC/bin/aCC -g +Z -DhpUXaCC11Platform +DAportable -DSABER -D_REENTRANT -D_HPUX_SOURCE -D_POSIX_SOURCE -D_THREAD_SAFE -DRWSTD_MULTI_THREAD -DRW_MULTI_THREAD -DEOS_TRACING -I/sw_common/osp5.3_EarlyDrop/osp/5.3/hpux11/include -I/sw_common/osp5.3_EarlyDrop/osp/5.3/hpux11/include/ClientOMR -I/sw_common/osp5.3_EarlyDrop/rpg/5.3/hpux11/include/ApplAccessMgr -I/sw_common/osp5.3_EarlyDrop/rpg/5.3/hpux11/include/abCommon/Gen -I../../include -I/opt/aCC/include -I/opt/aCC/include/iostream -I/usr/include -I- -I/sw_common/osp5.3_EarlyDrop/osp/5.3/hpux11/include -I../../include -c /oss/EOS/EOS410/eos4.10.08/eos_patch/EOS/src/libEosBuMibBase/EosBuMibBase/eosBuDomainBasePkg.C
...skipping forward
Error 566: "/oss/EOS/EOS410/eos4.10.08/eos_patch/EOS/src/libEosCsMibBase/EosCsMibBase/eosCCsOSIStateCache.C", line 60 # Static class member "static eosCCsOSIStateCache *eosCCsOSIStateCache::GetCacheInstance()" may not have this storage class.
static eosCCsOSIStateCache * ^
make: *** exit code 2 making eosCCsOSIStateCache.o ignored

Also in this case, we had no problem compiling the same source code with 3.13 aCC compiler.

Can someone help me????
7 REPLIES 7
Stefan Farrelly
Honored Contributor

Re: Problem with 3.31 aCC compiler

There seems to be problems with the compiler version 3.31, HP released a patch for it not long after, 3.35, which fixes lots of defects. Try installing this and see if it will compile;

PHSS_26952
Im from Palmerston North, New Zealand, but somehow ended up in London...
Prisco Antonietta
New Member

Re: Problem with 3.31 aCC compiler

Thanks for the answer, but we have the constraint due to third party software: we have to use 3.31 aCC compiler version.

Re: Problem with 3.31 aCC compiler

For the problem with assert.h, you should note that the name of the standard C++ header for assertion checking is called cassert. Similarly, for other old C headers (math.h became cmath, etc.).
Thanuja_1
New Member

Re: Problem with 3.31 aCC compiler

Hi,

We are getting error # 2

Error 566: "../include/converterObj.h", line 53 # Static class member
"converterObj *converterObj::cr" may not have this storage class.
static converterObj *converterObj::cr = NULL;

Does anybody have an answer to this ?
We had no problems compiling the code with version 3.25
We are currently using version 3.37 of the compiler.
I installed a patch PHSS_28756 hoping that it would solve the problem, but in vain.

Any help would be appreciated.
Thanks
Thanuja
Adam J Markiewicz
Trusted Contributor

Re: Problem with 3.31 aCC compiler

Hi

If this is outside of class declaration (as I asume) you should omit word 'static':


class converterObj {
static converterObj *cr;
};


/* NO 'static' HERE */ converterObj *converterObj::cr = NULL;



Good luck
Adam
I do everything perfectly, except from my mistakes
Thanuja_1
New Member

Re: Problem with 3.31 aCC compiler

Hi,

Thanks for responding.
We had tried uncommenting out the static declaration outside the class.
for eg :
class reader {
private :
static reader * rc;
:
:
};
reader *reader::rc == NULL;

The above declaration is in a header file. and couple of .C files include this header file.
The compilation is successful, but linking fails as the linker recognises "*reader::rc" as duplicate symbol

/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (readercacher.o) was
detected. The linked output may not run on a PA 1.x system.
/usr/ccs/bin/ld: Duplicate symbol "*reader::rc" in files readercacher.o an
d converterObj.o
/usr/ccs/bin/ld: Duplicate symbols are not allowed in shared libraries
*** Error exit code 1

One thing is to change the code completely, but we dont want to do it at this point of time. Is there any other way ?
I hope HP has some patch for this or maybe some compiler or linker option.

Thanks for your help
Thanuja
Adam J Markiewicz
Trusted Contributor

Re: Problem with 3.31 aCC compiler

Hi again

The easiest way:
Remove definition of the static object from header and add it to one of your .C files. This way you'll have only one in the resulting program.

The other way I can imagine is experimenting with templates. Templates can have static members, but have to be instantiated by the compiler on demand. So (I guess) compiler is allowed to generate several static objects, out of wich, the linked choses one without complainig. (it has to be marked by the compiler that linker should allow several object out of wich onle one has to be chosen).

The last thing:
reader *reader::rc == NULL;
I think you mean:
reader *reader::rc = NULL;


Good luck
Adam
I do everything perfectly, except from my mistakes