dostats does not compile on Linux

dostats does not compile on Linux

Post by ART KAGEL, BLOOMBERG/ 65E 55T » Sat, 15 Feb 2003 00:33:07



Hi Roland,

I'm posting this to several of the IIUG lists and CDI since it's generally
useful, hope that's OK with you.

Arrgghh!!  This is due to a change I had to make because some UNIXes (notably
AIX) do not have a getopt.h but include the definitions for getopt() and optarg
in stdlib.h.  Because of this earlier releases of dostats would not compile on
AIX.  Linux does have getopt.h and it IS included from stdio.h (and unistd.h for
 that matter) which the new dostats.ec includes, unfortunately, which I did not
notice before, getopt.h is only included if you #define __USE_XOPEN or #define
__USE_XOPEN2K.  So either

- add a #define for one of these before the first #include statement
- add -D__USE_XOPEN to the esql commandline
- BEST OPTION (since I do not know what other side-effects the defines will
have):  uncomment the #include "getopt.h" that is commented out at the end of
the #include list (just before the first EXEC SQL INCLUDE line) probably around
line 218 or so.

Note for the lists:  I will replace the #include with a specific ifdef for Linux
 in the next release.  If anyone else has a problem compiling on some platform
please let me know and I'll add to the ifdef'd platforms that get the #include.

Art S. Kagel

----- Original Message -----

At:  2/12  3:22

> Dear Mr. Kagel,

> I downloaded the latest version of utils2_ak (dated 2003/02/03)
> from the IIUG-Website and tried to compile dostats.ec (1.85) on a
> RedHat 8.0 system having CSDK 2.80UC1 installed. When I run
> "make dostats" the following error appears:

> dostats.ec: In function `main':dostats.ec:402: `optarg' undeclared (first use
in
> this function)dostats.ec:402: (Each undeclared identifier is reported only
> oncedostats.ec:402: for each function it appears in.)dostats.ec:941: `optind'
> undeclared (first use in this function)make: *** [dostats] Error 1
> Version 1.74 of dostats.ec from 2002/11/05 compiles fine.

> Could you please check this.

> Kind regards

> --
>    Roland Wintgen (Systemadministrator)

>    EVG Elektro-Vertriebs-Gesellschaft Martens GmbH & Co KG
>    Trompeterallee 244-246, 41189 M?nchengladbach
>    Tel. 0 21 66 / 55 08 23, Fax 0 21 66 / 55 08 90


 
 
 

1. dostats compile hep

I grabbed the latest dostats (1.76).  I could compiler earlier versions.  The
current version outputs the following error:

dostats.ec:175: getopt.h: No such file or directory

I am using Solaris 7 and IDS 7.31UD6.

My LD path is: LD_LIBRARY_PATH=/usr/informix/lib;/usr/informix/lib/esql

Thanks
Gary Quiring

2. Progress positions--MI

3. dostats.ec - need compiling help

4. Programming: A Faster COPY?

5. Linux/mips compile should not use -mips2

6. Invitation to International Forum

7. Kagel′s dostats installation in Linux

8. 4gl by example

9. compiled or not compiled

10. Sybase: stored procedures doing executes at compile time?

11. Linux and SQL 7 anybody done it?

12. doing a Level 0 restore with ontape under Linux

13. Linux/mips compile: [Fwd: Bug#139003: a little bit more