This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: mingw using wrong errno definition


"Ron Parker" <parkerrd@hotmail.com> writes:
> 
> The problem is I am getting the following errors trying to link
> cinstall. I have also included the compile line for the offending file.
> 
> make[1]: Entering directory
> `/home/rdparker/cygwin/obj/i686-pc-cygwin/winsup/cinstall/zlib'
> gcc -DPACKAGE=\"zlib\" -DVERSION=\"1.1.3\" -DHAVE_UNISTD_H=1
> -DHAVE_GETPAGESIZE=1 -DHAVE_MEMCPY=1 -DHAVE_STRERROR=1
> -DHAVE_UNISTD_H=1  -I. -I../../../../../src/winsup/cinstall/zlib
> -I../../../../../src/winsup/cinstall/zlib/..    -g -O2 -W -Wall
> -mno-cygwin -I../../../../src/winsup/mingw/include
> -I../../../../src/winsup/w32api/include -c
> ../../../../../src/winsup/cinstall/zlib/gzio.c
> rm -f libzcygw.a
> ar cru libzcygw.a adler32.o compress.o crc32.o deflate.o gzio.o
> infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o trees.o
> uncompr.o zutil.o
> ranlib libzcygw.a
> make[1]: Leaving directory
> `/home/rdparker/cygwin/obj/i686-pc-cygwin/winsup/cinstall/zlib'
> gcc -o setup.exe error.o memory.o setup.o strarry.o cinstall.o -g -O2
> -mno-cygwin zlib/libzcygw.a -lole32 -lwininet -lnetapi32 -ladvapi32
> -luuid
> zlib/libzcygw.a(gzio.o): In function `gz_open':
> /home/rdparker/cygwin/obj/i686-pc-cygwin/winsup/cinstall/zlib/../../../../../
> src/winsup/cinstall/zlib/gzio.c:155:
> undefined reference to `__errno'

This is typical of code that declares it's own errno instead of using the
declaration from system headers. I'm assuming of course that *all* code
here is built using -mno-cygwin so that there's no mix-and-match.

Search for `extern.*int.*errno' in your code. If there is such a thing,
delete and include <errno.h> for both Cygwin and Mingw.

If that's not the case, please send me a download URL for the code or
just email me the package (.tar.gz) if it's under a meg or so.

Regards,
Mumit


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]