This is the mail archive of the cygwin@cygwin.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]
Other format: [Raw text]

Re: getopt: ugly linker messages


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/


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