This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc: std::cout problem


The source code was:
-------------------------------------------------------
#include <iostream>

int main()
{

std::cout << "Hello,World!";

}

--------------------------------------------

and from the shell:

----------------------------------------------
$ gcc HelloWorld.cpp
/cygdrive/c/DOCUME~1/dAvId/LOCALS~1/Temp/ccEM3ulm.o(.text+0x37):HelloWorld.c
pp: undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/dAvId/LOCALS~1/Temp/ccEM3ulm.o(.text+0x3c):HelloWorld.c
pp: undefined reference to `std::basic_ostream<char, std::char_traits<char>
>& std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
/cygdrive/c/DOCUME~1/dAvId/LOCALS~1/Temp/ccEM3ulm.o(.text+0x65):HelloWorld.c
pp: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/cygdrive/c/DOCUME~1/dAvId/LOCALS~1/Temp/ccEM3ulm.o(.text+0x80):HelloWorld.c
pp: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
collect2: ld returned 1 exit status

Is this normal? With std::cout error?
I mean, is this from the source code itself?
To me, the source looks fine, though.


Thank you in advance.

David

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]