Compilation errors with aCC compiler - HP UX

This is a discussion on Compilation errors with aCC compiler - HP UX ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Compilation errors with aCC compiler

  1. 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.





  2. Re: Compilation errors with aCC compiler

    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.

+ Reply to Thread