f



Compilation errors with aCC compiler

Hi,

I am getting compilation error in folloing situation:

Here, I am giving sample piece of code.

a.h:
-------
extern int g_switch;

------

in "a.c",

g_switch = 0;

it is giving following error:

Error 173: "a.c", line 19 # Redefined symbol 'g_switch'; previously
defined at
    ["../../include/a.h", line 3].

But this code is working fine in all other systems like Suse, Solaris
and Windows.

System information :

HP-UX C3600 B.11.00 U 9000/785 2003506592 unlimited-user license

aCC version : aCC: HP ANSI C++ B3910B A.03.55

Please let me know if any compilation options to be added in this case
and if you need any further information.

Regards
Satish.




0
satish
6/30/2008 1:25:12 PM
comp.sys.hp.hpux 4408 articles. 1 followers. dewi.bening (7) is leader. Post Follow

1 Replies
1403 Views

Similar Articles

[PageSpeed] 14

satish.lvr@gmail.com wrote:
> I am getting compilation error in following situation:
> extern int g_switch;
> g_switch = 0;

This is not legal C++ code.  Nor is this valid C99 code.  You need to 
include the type "int" in the definition.

> it is giving following error:
> Error 173: "a.c", line 19 # Redefined symbol 'g_switch'; previously
> defined at ["../../include/a.h", line 3].

I get lots more errors than that.

> But this code is working fine in all other systems like Suse, Solaris
> and Windows.

These support K&R and C89.

> Please let me know if any compilation options to be added in this case
> Satish.

Did you intend to compile in C++ mode?  The HP C compiler gives a warning.
0
Dennis
7/1/2008 3:00:39 AM
Reply: