From: fjh AT cs DOT mu DOT OZ DOT AU (Fergus Henderson) Subject: Re: Where is random()? 15 Dec 1998 22:44:34 -0800 Message-ID: <19981216031216.63576.cygnus.gnu-win32@murlibobo.cs.mu.OZ.AU> References: <3673E58E DOT 93F1B604 AT fel DOT cvut DOT cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Mumit Khan Cc: Jan Tomasek , "gnu-win32 AT cygnus DOT com" On 14-Dec-1998, Mumit Khan wrote: > Jan Tomasek writes: > > Hi, > > I'm writing one school project in C and at home I working > > under CygWin 19.2 > > > > On my Linux (Debian) is on random() man page writen that it is in > > defined in stdlib.h > > * if I compile it with gcc on that linux all is ok > > * if I compile it with Cygnus gcc port I get warning: > > Learning standard from man pages is as full of pitfalls as learning a new > evolving computer language from a compiler. This is true. However, if you're going to choose a set of man pages to learn from, the Debian Linux ones are actually not too bad, because most of the man pages have a "CONFORMING TO" section which states which standard(s) support the function(s) in question. > `random' is not standard ANSI nor is it part of POSIX. Right. For random(), the Debian Linux man page states the following: CONFORMING TO BSD 4.3 Cygwin provides ANSI C, most of POSIX.1/1990, and some other stuff. For details, see the "What Unix API calls are supported by Cygwin?" section of the FAQ list. > The good news for you is that Cygwin comes with libiberty, which contains > a random function. Just add -liberty at the end of the list of libraries > when you link and you're set for now. BTW, the FAQ list says that Cygwin supports random() but doesn't mention the need to link in libiberty. -- Fergus Henderson | "Binaries may die WWW: | but source code lives forever" PGP: finger fjh AT 128 DOT 250 DOT 37 DOT 3 | -- leaked Microsoft memo. - 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".