[GRASS5] 5.1 compilation with gcc3.2.2: dbmi compilation error: sys_nerr/strerror

Yesterday I have tried to complile 5.1 on Mandrake 9.1.

With gcc version 3.2.2 the following problem appears in dbmi:

/home/neteler/grass51/include/gis.h:36: warning: `GRASS_copyright' defined but not used
gcc -L/home/neteler/grass51/dist.i686-pc-linux-gnu/lib -o /home/neteler/grass51/dist.i686-pc-linux-gnu/etc/form/form OBJ.i686-pc-linux-gnu/form.o /home/netel er/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a /home/neteler/grass51/dist.i686 /home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x15e) : In function `db_syserror':
/home/neteler/grass51/lib/db/dbmi/error.c:121: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x12c):/home/neteler/grass51/lib/db/dbmi/error.c:114: undefined reference to `errno'
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x168):/home/neteler/grass51/lib/db/dbmi/error.c:128: undefined reference to `errno'
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x1c4):/home/neteler/grass51/lib/db/dbmi/error.c:118: undefined reference to `errno'
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x2aa): In function `db_clear_error':
/home/neteler/grass51/lib/db/dbmi/error.c:202: undefined reference to `errno'
collect2: ld returned 1 exit status
make[2]: *** [/home/neteler/grass51/dist.i686-pc-linux-gnu/etc/form/form] Fehler 1
make[2]: Leaving directory `/home/neteler/grass51/lib/form'
make[1]: *** [subdirs] Fehler 1
make[1]: Leaving directory `/home/neteler/grass51/lib'
make: *** [default] Fehler 1

How can we fix this?

Thanks in advance

Markus

On Wed, Apr 02, 2003 at 05:43:13PM +0200, Markus Neteler wrote:

Yesterday I have tried to complile 5.1 on Mandrake 9.1.

With gcc version 3.2.2 the following problem appears in dbmi:

/home/neteler/grass51/include/gis.h:36: warning: `GRASS_copyright' defined but not used
gcc -L/home/neteler/grass51/dist.i686-pc-linux-gnu/lib -o /home/neteler/grass51/dist.i686-pc-linux-gnu/etc/form/form OBJ.i686-pc-linux-gnu/form.o /home/netel er/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a /home/neteler/grass51/dist.i686 /home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x15e) : In function `db_syserror':
/home/neteler/grass51/lib/db/dbmi/error.c:121: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x12c):/home/neteler/grass51/lib/db/dbmi/error.c:114: undefined reference to `errno'
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x168):/home/neteler/grass51/lib/db/dbmi/error.c:128: undefined reference to `errno'
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x1c4):/home/neteler/grass51/lib/db/dbmi/error.c:118: undefined reference to `errno'
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x2aa): In function `db_clear_error':
/home/neteler/grass51/lib/db/dbmi/error.c:202: undefined reference to `errno'
collect2: ld returned 1 exit status
make[2]: *** [/home/neteler/grass51/dist.i686-pc-linux-gnu/etc/form/form] Fehler 1
make[2]: Leaving directory `/home/neteler/grass51/lib/form'
make[1]: *** [subdirs] Fehler 1
make[1]: Leaving directory `/home/neteler/grass51/lib'
make: *** [default] Fehler 1

How can we fix this?

A dirty working (?) hack is

cvs diff lib/db/dbmi/error.c
Index: lib/db/dbmi/error.c

RCS /home/grass/grassrepository/grass51/lib/db/dbmi/error.c,v
retrieving revision 1.3
diff -r1.3 error.c
4,8d3
<
< #ifndef __CYGWIN__
< extern int errno;
< extern int sys_nerr;
< #else
10d4
< #endif

But I hesitate to submit to CVS - recommendations?

Markus

Markus Neteler wrote:

Yesterday I have tried to complile 5.1 on Mandrake 9.1.

With gcc version 3.2.2 the following problem appears in dbmi:

/home/neteler/grass51/include/gis.h:36: warning: `GRASS_copyright' defined but not used
gcc -L/home/neteler/grass51/dist.i686-pc-linux-gnu/lib -o /home/neteler/grass51/dist.i686-pc-linux-gnu/etc/form/form OBJ.i686-pc-linux-gnu/form.o /home/netel er/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a /home/neteler/grass51/dist.i686 /home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x15e) : In function `db_syserror':
/home/neteler/grass51/lib/db/dbmi/error.c:121: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x12c):/home/neteler/grass51/lib/db/dbmi/error.c:114: undefined reference to `errno'
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x168):/home/neteler/grass51/lib/db/dbmi/error.c:128: undefined reference to `errno'
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x1c4):/home/neteler/grass51/lib/db/dbmi/error.c:118: undefined reference to `errno'
/home/neteler/grass51/dist.i686-pc-linux-gnu/lib/libdbmi.a(error.o)(.text+0x2aa): In function `db_clear_error':
/home/neteler/grass51/lib/db/dbmi/error.c:202: undefined reference to `errno'
collect2: ld returned 1 exit status
make[2]: *** [/home/neteler/grass51/dist.i686-pc-linux-gnu/etc/form/form] Fehler 1
make[2]: Leaving directory `/home/neteler/grass51/lib/form'
make[1]: *** [subdirs] Fehler 1
make[1]: Leaving directory `/home/neteler/grass51/lib'
make: *** [default] Fehler 1

How can we fix this?

I've committed the obvious fix (i.e. stick to the standards). If there
are any problems with this, then we'll need configure checks.

--
Glynn Clements <glynn.clements@virgin.net>