Operating System - HP-UX
1827808 Members
2048 Online
109969 Solutions
New Discussion

Compilation error using template vector

 
Raghav_3
Occasional Advisor

Compilation error using template vector

Hi,

I am trying to compile my appl source code on HP UX 11 using aCC compiler. My source code has references to STL vector template etc. I am getting the following error during compliation
The following is the compilation command and the error

aCC -O +Z -DNO_STD_NAMESPACE -DUNIX -DNO_PRAGMA -DFAO_PMF_STYLE -I. -I/var/peop
le/synergy/esisoft/VISUAL_CRASH/DevEnv/inc/xmlparser -I/var/people/synergy/esiso
ft/VISUAL_CRASH/DevEnv/inc/xmlparser/include -I/usr/local/ux11/include/python2.
3 -I/usr/local/include/python2.3 -D_HOST_ENV -DNO_STD_NAMESPACE -DHPUX -DHP -D
PAM_HP -I/opt/graphics/OpenGL/include -D__hpux -D_REENTRANT -D_HPUX_SOURCE -D_FI
LE_OFFSET_BITS=64 -DSECURITY_ENV=1 -I/lyon/meltem_9/esisoft/pamflex/v2003_9.0.0/
include -DSWIG_COBJECT_TYPES -c dmtools/weld/GenericMwfIO.cpp -o /var/people/s
ynergy/esisoft/bin/host_env_devV4/obj/vdb/ux11_optimized/GenericMwfIO.o

Error 173: "/usr/include/sys/times.h", line 47 # Redefined symbol 'times';
previously defined at ["/opt/aCC/include/functional", line 112].
extern clock_t times(struct tms *);

Please let me know how to correct this error.

Thanks in advance,
Raghav
8 REPLIES 8
Alex Lavrov.
Honored Contributor

Re: Compilation error using template vector

What version of aCC do you use?
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Raghav_3
Occasional Advisor

Re: Compilation error using template vector

Hi,

The aCC version is

aCC: HP ANSI C++ B3910B A.03.30

Thanks,
Raghav
Alex Lavrov.
Honored Contributor

Re: Compilation error using template vector

the problem is that the same variable defined twice. Can't you compile it with the newest version of gcc?

If not, you can try to remove the definition from one of the included files.

Worked for me once.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Raghav_3
Occasional Advisor

Re: Compilation error using template vector

Hi,

The "times" variable is defined in /usr/include/sys/times.h and /opt/aCC/include/functional headers. The functional header i think got included thro' the #include .

How can i remove the definition of times from the system header files or rather how to undefine it thro' my source code

We need to compile using native HP aCC compiler.

Is it possible that a newer patch of aCC would have fixed this issue?

Thanks,
Raghav
Stephen Keane
Honored Contributor

Re: Compilation error using template vector

How about -D__cplusplus

Raghav_3
Occasional Advisor

Re: Compilation error using template vector

Hi,

I think the __cplusplus will be defined by the aC++ compiler. Do we need to redefine the same?

Thanks,
Raghav
Stephen Keane
Honored Contributor

Re: Compilation error using template vector

It SHOULD be defined by the compiler, I just wanted to make sure it was. If nothing changes (you get the same error), then at least we've checked.
Raghav_3
Occasional Advisor

Re: Compilation error using template vector

Hi,

The __cplusplus is defined. I however got a link to an info
"http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,432,00.html"
which has a workaround for this issue and it worked for me.
It involves setting the __HPACC_USING_MULTIPLIES_IN_FUNCTIONAL defines

Thanks,
Raghav