getopt: ugly linker messages

Rolf Campbell Endlisnis@mailc.net
Thu Sep 18 21:46:00 GMT 2003


Bryan Higgins wrote:
> Christopher Faylor wrote:
> 
> 
>>You can use unistd.h if you want.  If you knew this already why were you
>>asking the question?
> 
> 
> From the gnu getopt(3) man page (mysteriously missing in cygwin):
> 
>        #include <unistd.h>
> 
>        int getopt(int argc, char * const argv[],
>                   const char *optstring);
> 
>        extern char *optarg;
>        extern int optind, opterr, optopt;
> 
> If one does this with the latest cygwin, ugly linker messages result.
> 

I believe you are interpreting the man page incorrectly.  You should 
only include <unistd.h> and not the 4 lines below that.  The rest of the 
lines are only to show you the signature.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list