X-Recipient: archive-cygwin AT delorie DOT 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: <4C87CA1A DOT 9070301 AT sh DOT cvut DOT cz> Date: Wed, 8 Sep 2010 13:38:35 -0500 Message-ID: Subject: Re: rand() was not declared in this scope, please help‏ From: mike marchywka To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 9/8/10, V=E1clav Haisman 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 >> >> I tried >> #inlcude >> >> 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 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