Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin@cygwin.com
From: Rolf Campbell <Endlisnis@mailc.net>
Subject: Re: getopt: ugly linker messages
Date: Thu, 18 Sep 2003 17:32:22 -0400
Lines: 25
Message-ID: <bkd896$8vs$1@sea.gmane.org>
References: <200309182018.h8IKIVWa019609@bolt.sonic.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@sea.gmane.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1
X-Accept-Language: en-us, en
In-Reply-To: <200309182018.h8IKIVWa019609@bolt.sonic.net>

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/

