Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Reply-To: From: "Norman Vine" To: "'Dan Mergens'" , Subject: RE: vector Date: Thu, 22 Aug 2002 08:07:42 -0400 Message-ID: <03bd01c249d4$859f4fe0$a300a8c0@nhv> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal In-Reply-To: <3D649A95.3503A7BF@photon.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal X-Virus-Scanned: Cape.Com VirusScan, no known virus found Dan Mergens writes: > >I'm baffled why this simple program produces the following errors. >Strangly enough, if I remove the push_back call, it compiles without >complaint. > >I'm running the latest version of cygwin. I'm sure I'm missing >something... > >Thanks, >Dan > >-------------- test.C ------------------ >#include >void main() { >vector array; >array.push_back(10); >} >---------------------------------------- This is really OT for this list but since there have been several similar posts recently < please use a general C++ programming list > try // compile with g++ < or c++ > // c++ test.C // if compiling with gcc libstdc++ must be linked explicitly // gcc test.C -lstdc++ #include int main(void) { std::vector array; array.push_back(10); return 0; } note that main() MUST be declared to return an int and that vector<> MUST be qualified Norman -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/