Operating System - HP-UX
1752754 Members
5389 Online
108789 Solutions
New Discussion юеВ

Re: error #2247: member has already been defined

 
Anwarul Kabir
Advisor

error #2247: member has already been defined

Trying to compile a 32 bit running application in 64 bit and getting this error:

aCC +DD64 -AA -z -g -mt -DSTD_AA +Z -I. -I../inc -I../../../lib/db_ob/inc -I../../../lib/utility/inc -I../../../lib/xml/inc -c xlator_11.cpp
"xlator_11.cpp", line 30: error #2247: member "xlator_11::factory9_" has
already been defined
xlator_11::factory9_("MIS_IND_ALIAS_ADD", new(nothrow) xlator_11("1", false, true));
^

"xlator_11.cpp", line 30: error #2018: expected a ")"
xlator_11::factory9_("MIS_IND_ALIAS_ADD", new(nothrow) xlator_11("1", false, true));
^

Code in the xlator.cpp in line 30(here I am copying from line 25+-) are:

aggregate_factory
xlator_11::factory8_("MIS_IND_ADMIN_ADD", new(nothrow) xlator_11("8", false));
aggregate_factory
xlator_11::factory9_("PDB_IND_ALIAS_ADD", new(nothrow) xlator_11("1", false, true));
aggregate_factory
xlator_11::factory9_("MIS_IND_ALIAS_ADD", new(nothrow) xlator_11("1", false, true));
aggregate_factory
xlator_11::factory10_("PDB_IND_UPD", new(nothrow) xlator_11("3", false, true));
aggregate_factory
xlator_11::factory11_("MIS_IND_UPD", new(nothrow) xlator_11("3", false, true));

Now I can see its call factory9 twice but my guess since its working in 32 why its giving me an error in 64? is there a syntax change that i need to do for the 64 compiler to understand this code?
9 REPLIES 9
Anwarul Kabir
Advisor

Re: error #2247: member has already been defined

aggregate_factory
xlator_11::factory9_("PDB_IND_ALIAS_ADD", new(nothrow) xlator_11("1", false, true));
aggregate_factory
xlator_11::factory9_("MIS_IND_ALIAS_ADD", new(nothrow) xlator_11("1", false, true));
Dennis Handly
Acclaimed Contributor

Re: error #2247: member has already been defined

It looks illegal to me. Why are you trying to define the same variable factory9_ twice?

Have you compiled your application in 32 bit mode?
Anwarul Kabir
Advisor

Re: error #2247: member has already been defined

I didn't compile it my self but the application is running as we speak and in production. its an old application which had been working for at leat 5/10 years i believe...
Dennis Handly
Acclaimed Contributor

Re: error #2247: member has already been defined

>Its an old application which had been working for at least 5/10 years I believe.

The aCC6 compiler is better at catching errors, aCC5 ignored the duplicate.

Before you ported to 64 bit, have you compiled with aCC6 just to see what messages you got?
Anwarul Kabir
Advisor

Re: error #2247: member has already been defined

no. They just gave me the code and told me to compile it in new system...
I am not sure what version of acc they have used for the old system.
one thing is if i commented out the 2nd line it compiles but i am afraid that the application will not do what it suppose to do if i comment out lines like these, as they have used same kind of duplicate declration in many places....
Dennis Handly
Acclaimed Contributor

Re: error #2247: member has already been defined

>I am not sure what version of aCC they have used for the old system.

It is obsolete aCC5.

>but I am afraid that the application will not do what it suppose to do if I comment out lines like these

aCC5 seems to ignore the second one.
Anwarul Kabir
Advisor

Re: error #2247: member has already been defined

I was able to do a aCC - V in the old system and in the new too

OLD:
aCC: HP ANSI C++ B3910B A.03.63

New:
aCC: HP C/aC++ B3910B A.06.15 [May 16 2007]
Dennis Handly
Acclaimed Contributor

Re: error #2247: member has already been defined

>A.03.63

This is aCC3, it has the similar problems as aCC5.
Anwarul Kabir
Advisor

Re: error #2247: member has already been defined

I guess its then the compiler. I have actually created a second line like the error in the header so that it was defined twice in header and that has stopped the error in the cpp.

Hopefully this will work.