From: cmcguinn AT macha DOT ucd DOT ie (Cormac McGuinness) Subject: Can I use getopt in a simple program with cygwin32 ? 10 Feb 1998 20:40:09 -0800 Message-ID: <199802102330.XAA01168.cygnus.gnu-win32@macha.ucd.ie> To: gnu-win32 AT cygnus DOT com Hi, I have a simple program that is command line driven and calls getopt within the program, however when i compile it using "gcc file.c" I get file.c: in function 'main': file.c:47: 'optarg' undeclared (first use this function) file.c:47: (Each undeclared identifier is reported only once file.c:47: for each function it appears in.) file.c:91: 'optopt' undeclared (first use this function) What is going on? The same source code compiles under Linux and HP-UX no problem... can I not use the optopt and optarg and optind variables that i would expect the calling of the function getopt to set ??? Please e-mail me a reply, as I do not subscribe to the mailing list, but searched through the archives for an answer..... Thanks in advance Cormac -- ------------------------------------------------------------------------------- Cormac McGuinness e-mail: cmcguinn AT macha DOT ucd DOT ie cmcg AT frank DOT physics DOT dcu DOT ie =============================================================================== Experimental Physics Department, Tel: + 353 1 706 2205 University College Dublin, Fax: + 353 1 283 7275 Belfield, Dublin 4, Ireland. Also: School of Physical Sciences, Tel: + 353 1 704 5840 Dublin City University, Fax: + 353 1 704 5384 Glasnevin, Dublin 9, Ireland - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".