Compilation problem - HP UX

This is a discussion on Compilation problem - HP UX ; Hi I developed an application in Red Hat Linux. It was working fine there. When I am porting to HP-UX I am getting compilation error. The error is given below. cc: "/usr/include/sys/dir.h", line 74: error 1000: Unexpected symbol: "ino32_t". cc: ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Compilation problem

  1. Compilation problem

    Hi I developed an application in Red Hat Linux. It was working fine
    there. When I am porting to HP-UX I am getting compilation error. The
    error is given below.

    cc: "/usr/include/sys/dir.h", line 74: error 1000: Unexpected symbol:
    "ino32_t".
    cc: "/usr/include/sys/dir.h", line 75: error 1000: Unexpected symbol:
    "d_reclen".
    cc: "/usr/include/sys/dir.h", line 75: warning 557: Missing declaration
    specifiers, "int" assumed.
    cc: "/usr/include/sys/dir.h", line 76: error 1000: Unexpected symbol:
    "d_namlen".
    cc: "/usr/include/sys/dir.h", line 76: warning 557: Missing declaration
    specifiers, "int" assumed.
    cc: "/usr/include/sys/dir.h", line 91: error 1000: Unexpected symbol:
    "}".
    cc: "/usr/include/sys/dir.h", line 182: warning 557: Missing
    declaration specifiers, "int" assumed.
    cc: "/usr/include/sys/dir.h", line 182: error 1000: Unexpected symbol:
    "*".
    cc: panic 2017: Cannot recover from earlier errors, terminating.

    But I did n't include the header file dir.h. Even with that header file
    also I am getting the same error. Can anyone give solution to resolve
    this. Thanks in advance.


  2. Re: Compilation problem

    ksp_win@sify.com wrote:
    > Hi I developed an application in Red Hat Linux. It was working fine
    > there. When I am porting to HP-UX I am getting compilation error.


    Which version of HP-UX?

    > The error is given below.


    > cc: "/usr/include/sys/dir.h", line 74: error 1000: Unexpected symbol:
    > "ino32_t".
    > cc: "/usr/include/sys/dir.h", line 75: error 1000: Unexpected symbol:
    > "d_reclen".
    > cc: "/usr/include/sys/dir.h", line 75: warning 557: Missing declaration
    > specifiers, "int" assumed.
    > cc: "/usr/include/sys/dir.h", line 76: error 1000: Unexpected symbol:
    > "d_namlen".
    > cc: "/usr/include/sys/dir.h", line 76: warning 557: Missing declaration
    > specifiers, "int" assumed.
    > cc: "/usr/include/sys/dir.h", line 91: error 1000: Unexpected symbol:
    > "}".
    > cc: "/usr/include/sys/dir.h", line 182: warning 557: Missing
    > declaration specifiers, "int" assumed.
    > cc: "/usr/include/sys/dir.h", line 182: error 1000: Unexpected symbol:
    > "*".
    > cc: panic 2017: Cannot recover from earlier errors, terminating.


    > But I did n't include the header file dir.h. Even with that header file
    > also I am getting the same error. Can anyone give solution to resolve
    > this. Thanks in advance.


    It could be there are one or more other include files that dir.h
    expects to have been included prior to its inclusion, that it is not
    including itself. Or there is a predefined symbol that needs to be
    set first?

    My 11.11 system has no ino32_t in dir.h, but it does appear in
    dirent.h, and may be defined in types.h:

    $ find /usr/include -exec grep -l ino32_t {} \;
    /usr/include/sys/dirent.h
    /usr/include/sys/types.h

    The find and grep commands can be very useful when working-out include
    file problems.

    rick jones
    --
    oxymoron n, commuter in a gas-guzzling luxury SUV with an American flag
    these opinions are mine, all mine; HP might not want them anyway...
    feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...




  3. Re: Compilation problem

    Rick Jones wrote:
    > ksp_win@sify.com wrote:
    >
    >>Hi I developed an application in Red Hat Linux. It was working fine
    >>there. When I am porting to HP-UX I am getting compilation error.

    >
    >
    > Which version of HP-UX?


    Looks like 11.22 or later, Rick.

    >>The error is given below.
    >>cc: "/usr/include/sys/dir.h", line 74: error 1000: Unexpected symbol:
    >>"ino32_t".
    >>cc: "/usr/include/sys/dir.h", line 75: error 1000: Unexpected symbol:
    >>"d_reclen".
    >>cc: "/usr/include/sys/dir.h", line 75: warning 557: Missing declaration
    >>specifiers, "int" assumed.
    >>cc: "/usr/include/sys/dir.h", line 76: error 1000: Unexpected symbol:
    >>"d_namlen".
    >>cc: "/usr/include/sys/dir.h", line 76: warning 557: Missing declaration
    >>specifiers, "int" assumed.
    >>cc: "/usr/include/sys/dir.h", line 91: error 1000: Unexpected symbol:
    >>"}".
    >>cc: "/usr/include/sys/dir.h", line 182: warning 557: Missing
    >>declaration specifiers, "int" assumed.
    >>cc: "/usr/include/sys/dir.h", line 182: error 1000: Unexpected symbol:
    >>"*".
    >>cc: panic 2017: Cannot recover from earlier errors, terminating.

    >
    >
    >>But I did n't include the header file dir.h. Even with that header file
    >>also I am getting the same error. Can anyone give solution to resolve
    >>this. Thanks in advance.


    Well, you need ino32_t for *something* that includes (can't
    really tell what from what you posted.. no core header I could find with
    a quick search includes dir.h for you). That's in , so
    include that if you aren't already. That will also give you u_short
    (which is the type of d_reclen, assuming that's the line 75 problem).
    Make sure you define _INCLUDE_HPUX_SOURCE to get it. I think that
    is throwing off the end of the structure on 91, causing the DIR
    structure that follows to not be interepreted properly... causing the
    error on 182 for the extern'ed prototype returning a DIR *.

    So try including and defining _INCLUDE_HPUX_SOURCE and
    see what you get then.

    Don


  4. Re: Compilation problem

    Thanks sir. After adding #include before #include
    it is working fine.


+ Reply to Thread