yest Compiling Error

Help
DEYTEL
2007-03-21
2012-09-03
  • DEYTEL
    DEYTEL
    2007-03-21

    Can someone give me some help with the compiling the yest on an HPUX box.

    I do the following.

    /opt/gcc/bin/gcc -o /home/deytel/bin/yest /home/deytel/yest-2.7.0.4.c

    I get this.

    /home/deytel/yest-2.7.0.4.c: In function main': /home/deytel/yest-2.7.0.4.c:1470: structure has no member namedtm_zone'

    I downloaded it directy from the web site.

    Any help would be great. This might be a simple issue put I don't do a lot of c coding or compiling.

    Thanks

    Don.

     
    • Craig Regester
      Craig Regester
      2007-05-03

      Yup, the changes you detailed did allow it to compile and yest now works! Thank you so much!!

       
    • Apparently HPUX uses the same library as Sun OS. Use the command:
      gcc -DSUNOS -o /home/deytel/bin/yest /home/deytel/yest-2.7.0.4.c

      Should compile and run just fine.

      Kimball

       
    • Craig Regester
      Craig Regester
      2007-05-03

      I am also trying to compile on HP-UX. I do not have gcc installed so I used 'cc -DSUNOS -o /usr/bin/yest yest-2.7.0.4.c' and that got rid of the errors DEYTEL mentioned above, but I am still getting these:

      (Bundled) cc: "yest-2.7.0.4.c", line 212: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 213: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 214: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 215: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 216: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 217: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 218: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 219: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 220: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 221: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 716: error 1705: Function prototypes are an
      ANSI feature.
      (Bundled) cc: "yest-2.7.0.4.c", line 752: error 1705: Function prototypes are an
      ANSI feature.

      I am desperately wanting yest because I dont have access to gnu date and yest looks amazingly powerful for what I need to do. Any assistance would be excellent! Thank you!!

       
    • I do not have access to HP-UX right now, but it just looks like it's having trouble with the function prototypes. Here is my suggestion. Find the "Functions declarations" code:

      / ===========================================================================
      * functions declarations
      /
      void yest_help(void);
      void yest_version(void);
      void store_year(int);
      void store_month(int);
      void store_month_day(int);
      void store_time(void);
      time_t date_epoch(void);
      time_t date_eu(void);
      time_t date_iso(void);
      time_t date_us(void);

      And remove, or comment out, these lines. For instance:

      / ===========================================================================
      * functions declarations
      * DELETED FOR HP-UX compiler (just move the end-comment to below the prototypes)
      void yest_help(void);
      void yest_version(void);
      void store_year(int);
      void store_month(int);
      void store_month_day(int);
      void store_time(void);
      time_t date_epoch(void);
      time_t date_eu(void);
      time_t date_iso(void);
      time_t date_us(void);
      /

      Kimball

       
    • Craig Regester
      Craig Regester
      2007-05-03

      That did remove most of the errors but I am still left with the ones on line 716 and 752.

      716: int main(int argc, char *argv[])

      752: (def_date) (void); / Pointer to a date-store function */

       
    • Craig Regester
      Craig Regester
      2007-05-03

      I should note that I didn't try commenting those out as the one at 716 obviously opens up a method so I would be breaking something there :)

       
    • Craig Regester
      Craig Regester
      2007-05-03

      I did some more reading and discovered that this is due to using the built in cc compiler apparantly in HP-UX:

      "This is telling you that the Bundled C compiler only understands K & R syntax. The Bundled compiler is really only intended to be used to build kernels although limited deveopment can be done. If you want to do serious development then you need to purchase the ANSI C compiler or the aCC (C++) compiler. A free alternative is gcc which you can download."

      Reference: http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=975114&admit=-682735245+1178201048249+28353475

      So, I need to get the Gnu gcc compiler and try again I believe.

       
    • Sorry, I missed those.

      Change 716 from:

      int main(int argc, char *argv[])
      {


      to:

      int main(argc, argv)
      int argc;
      char *argv[];
      {


      The 752 one, try changing:

          (*def_date) (void); /* Pointer to a date-store function */
      

      To:

          (*def_date)();  /* Pointer to a date-store function */
      

      Let me know.
      Kimball

       
    • The very original yest program was written to compile under HP-UX's bundled compiler, so the changes needed to go back to that syntax shouldn't be extensive. I think it will compile with the above changes.

      Kimball