X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.4 required=5.0	tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4C87CA1A.9070301@sh.cvut.cz>
References: <CD7CFA1134410784EA0A1AA09A4D2A5B@ericlin.fsshl.zzn.com>	<4C87CA1A.9070301@sh.cvut.cz>
Date: Wed, 8 Sep 2010 13:38:35 -0500
Message-ID: <AANLkTi=jeOB1WLKFDF2WA6Ap4=mdQPonpo4gmUqySOpS@mail.gmail.com>
Subject: Re: rand() was not declared in this scope, please help&#8207;
From: mike marchywka <marchywka@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 9/8/10, V=E1clav Haisman <v.haisman@whithaus.giv> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> eric lin wrote, On 8.9.2010 19:35:
>> dear cygwin/gcc users:
>>
>>   I compile a simple code which i copied from a book, "The Complete
>> Reference of C++"  Fourth Edition by Herbert Schildt in page 575, rand()
>> which is clearly not be included in
>> #include <iostream>
>>
>> I tried
>> #inlcude <cmath>
>>
>> it still not compile, i.e. same compile error
>>
>> please help(see which lib I should include)
>> /* I tried in ubuntu linux on my laptop, it also not compile by same
>> reason */
> You need to #include <cstdlib> and use std::rand().
>
> - --
> VH
goog:

http://www.google.com/#sclient=3Dpsy&hl=3Den&q=3Drand%28%29+include+header&=
aq=3Df&aqi=3D&aql=3D&oq=3D&gs_rfai=3D&pbx=3D1&fp=3Dfb33825a2a74a863

also I'd mention that grepping in the include path can work.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

