This is the mail archive of the cygwin@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]

Can I use getopt in a simple program with cygwin32 ?


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@macha.ucd.ie
                                                cmcg@frank.physics.dcu.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@cygnus.com" with one line of text: "help".


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