X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org From: Peter M Lee To: cygwin AT cygwin DOT com Subject: iostream with gcc Date: 25 Oct 2007 10:14:17 +0100 X-Mailer: Prayer v1.0.18 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 X-York-MailScanner: Found to be clean X-York-MailScanner-From: pml1 AT york DOT ac DOT uk X-IsSubscribed: yes 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 I apologize for what is probably a silly mistake on my part. I am just starting to use cygwin. When I tried a simple program #include using namespace std; /** * A simple program for demonstrating the basics of a C++ project. */ int main() { cout << "Hello, world"; cout << endl; return 0; } with $ gcc hello.cc I got the following error message /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0xd): undefined reference to `std::basic_string, std::allocator >::size() const' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0x60): undefined reference to `std::basic_string, std::allocator >::operator[](unsigned int) const' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0x9f): undefined reference to `std::basic_string, std::allocator >::operator[](unsigned int) const' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0xce): undefined reference to `std::basic_string, std::allocator >::operator[](unsigned int) const' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0x135): undefined reference to `std::cout' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0x13a): undefined reference to `std::basic_ostream >& std::operator<< >(std::basic_ostream >&, char const*)' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0x142): undefined reference to `std::basic_ostream >& std::endl >(std::basic_ostream >&)' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0x149): undefined reference to `std::cout' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0x14e): undefined reference to `std::basic_ostream >::operator<<(std::basic_ostream >& (*)(std::basic_ostream >&))' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0x177): undefined reference to `std::ios_base::Init::Init()' /cygdrive/c/Users/PB2579~1/AppData/Local/Temp/cc7nz7Xj.o:hello.cc:(.text+0x192): undefined reference to `std::ios_base::Init::~Init()' collect2: ld returned 1 exit status -- 00 O O o o... 0 ____ _______________ ______________________ _________________ ][_n_i_|( |_ | | | 6 Arncliffe Mews | | pml1 | ( _ | ||| | Peter M Lee | | Alma Terrace | | @york.ac.uk | _||_|___|_|||_|_____________|_|___York__YO10_4EL___|_|+44_1904_654200| o 0--0 o o o o-o o-o o o o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/