X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_50,RCVD_IN_RP_RNBL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <4C87CA1A.9070301@sh.cvut.cz> Date: Wed, 08 Sep 2010 19:38:34 +0200 From: =?UTF-8?B?VsOhY2xhdiBIYWlzbWFu?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: rand() was not declared in this scope, please help‏ References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 -----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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREIAAYFAkyHyhoACgkQeqrf2dJjGj4mMwD+L7zWAHf7L34vlph03R5TY4Rw pizg2rsAWzelNkZHYGoBAMMSTJU7BF65E84+U5SAn2avkW/ZNGnGsj/aHeRnZHex =4x2u -----END PGP SIGNATURE----- -- 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