Operating System - Linux
1821638 Members
2973 Online
109633 Solutions
New Discussion юеВ

Re: Compilation error in cpp file on HPUX platform

 
SOLVED
Go to solution
sarram
Occasional Advisor

Compilation error in cpp file on HPUX platform

Hi,

I am trying to compile c++ file on HPUX11.11 platform. Compiler version is A.03.55.

I am getting error as shown below. But the same code worked for other platforms like solaris,linux.

Can anyone tell me what could be the reason for this error?

"Warning 134: "/opt/aCC/include/limits", line 112 # Expected 2 arguments for macro
'max'.
static inline T max () RWSTD_INLINE_NO_THROW { return RWSTD_STATIC_CAST(T,0); }
^^^
Error 20: "/opt/aCC/include/limits", line 112 # '' expected before ')'.
static inline T max () RWSTD_INLINE_NO_THROW { return RWSTD_STATIC_CAST(T,0); }
^^^
Error 19: "/opt/aCC/include/limits", line 112 # Unexpected '>'.
static inline T max () RWSTD_INLINE_NO_THROW { return RWSTD_STATIC_CAST(T,0); }
^^^
Error 24: "/opt/aCC/include/limits", line 112 # ')' expected instead of '?'.
static inline T max () RWSTD_INLINE_NO_THROW { return RWSTD_STATIC_CAST(T,0); }
^^^
Error 445: "/opt/aCC/include/limits", line 112 # Cannot recover from earlier errors.
static inline T max () RWSTD_INLINE_NO_THROW { return RWSTD_STATIC_CAST(T,0); }"

Advance Thanks
3 REPLIES 3
Steve Steel
Honored Contributor

Re: Compilation error in cpp file on HPUX platform

Hi


There is obviously a difference of order

Macros max has been defined earlier
in you source.You must try to include the
system file first before compiler specific and all other includes.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
sarram
Occasional Advisor

Re: Compilation error in cpp file on HPUX platform

Thanks Steve. But why the same code is working for Solaris and Linux.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Compilation error in cpp file on HPUX platform

Because some of the standard header files are different. Almost certainly there is a macro "max" that is interfering. An "#undef max" will probably fix you. Note that Solaris and Linux are not using aCC so you are comparing apples and oranges.
If it ain't broke, I can fix that.