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 Date: Tue, 16 Sep 2003 18:43:25 EDT To: cygwin AT cygwin DOT com Subject: Re: g++ iostream broken on windows 2000 Message-Id: In-Reply-To: References: <20030915234312 DOT 66294 DOT qmail AT web40708 DOT mail DOT yahoo DOT com> From: Brian Keener Reply-To: Brian Keener Alex Vinokur wrote: > > # include > > # include > > using namespace std; // must be for g++ 3.x; otherwise you should use not 'cout' but 'std::cout', etc. > > > > Could someone tell me what I am doing wrong or do I have something set up wrong in my install. I am simply trying to learn but if I put this in a file called first.cpp: // // this is first test application // #include using namespace std; int main() { cout << "Welcome to C++\r\n"; cout << "Hope you learn a lot\r\n"; } and then do: /usr/develop/src/learning $ gcc -g -o ./debug/first.exe ./first.cpp I get this for output - not too pretty. /tmp/ccRHUQ8U.o(.text+0x49): In function `main': /usr/develop/src/learning/first.cpp:11: undefined reference to `std::cout' /tmp/ccRHUQ8U.o(.text+0x56):/usr/develop/src/learning/first.cpp:11: undefined re ference to `std::basic_ostream >& std::operator<< < std::char_traits >(std::basic_ostream >&, cha r const*)' /tmp/ccRHUQ8U.o(.text+0x5d):/usr/develop/src/learning/first.cpp:12: undefined re ference to `std::cout' /tmp/ccRHUQ8U.o(.text+0x6a):/usr/develop/src/learning/first.cpp:12: undefined re ference to `std::basic_ostream >& std::operator<< < std::char_traits >(std::basic_ostream >&, cha r const*)' /tmp/ccRHUQ8U.o(.text+0x93): In function `_Z41__static_initialization_and_destru ction_0ii': /usr/include/c++/3.2/iostream:62: undefined reference to `std::ios_base::Init::I nit[in-charge]()' /tmp/ccRHUQ8U.o(.text+0xae):/usr/include/c++/3.2/iostream:62: undefined referenc e to `std::ios_base::Init::~Init [in-charge]()' /tmp/ccRHUQ8U.o(.eh_frame+0x11):first.cpp: undefined reference to `___gxx_person ality_v0' collect2: ld returned 1 exit status /usr/develop/src/learning $ And it doesn't get any better if I try it with -mno-cygwin. I can compile the Cygwin cvs tree and the setup cvs tree but those you makefiles. Any help or a pointer would be appreciated. bk -- 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/