postgres link failure on cygwin 1.0

Mumit Khan khan@NanoTech.Wisc.EDU
Mon Feb 28 09:37:00 GMT 2000

Kyle Downey <> writes:
> I'm getting a link failure looking for _sys_nerr (from errno.h) when compilin
> g
> postgresql 6.5.3 on cygwin 1.0 (CD distro, unmodified except for addition of
> the CWilson /usr/local and cygipc 1.05 distros. I have notified the maintaine
> r
> about this, but since he says in the docs it compiles on b20.1, I wanted to
> see if it was just a Cygwin b20.1 -> 1.0 change, esp. because it's a system
> call that's missing. I may just have to add a library that I don't know
> about.
> What puzzles me is that _sys_nerr is defined in libcgywin.dll, which is being
> linked against:

You've probably fallen into the trap of *declaring* _sys_nerr as an
external variable without importing it from the DLL. 

Check for the following in your code:
  extern int _sys_nerr;

which is incorrect. Remove that and use the definition from <errno.h>,
which is:

  extern int _sys_nerr __declspec(dllimport);


Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list