Mail Archives: djgpp/2000/08/08/06:15:27
Thanx for your help.
I do add "using namespace std;", but it gives me :
ccaa.cc:2: warning: namespaces are mostly broken in this version of
g++
d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x2f):ccaa.cc: undefined
reference to `cin'
d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x34):ccaa.cc: undefined
reference to `istream::operator>>(int &)'
d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x3e):ccaa.cc: undefined
reference to `endl(ostream &)'
d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x51):ccaa.cc: undefined
reference to `cout'
d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x56):ccaa.cc: undefined
reference to `ostream::operator<<(char const *)'
d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x61):ccaa.cc: undefined
reference to `ostream::operator<<(int)'
d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x6c):ccaa.cc: undefined
reference to `ostream::operator<<(char const *)'
d:/langages/c__~1/djgpp/tmp\ccdaaaaa(.text+0x77):ccaa.cc: undefined
reference to `ostream::operator<<(ostream &(*)(ostream &))'
It doesn't compile!
On Tue, 08 Aug 2000 00:53:07 GMT, Damian Yerrick
<Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p> wrote:
>On 07 Aug 2000 13:59:12 -0700, Nate Eldredge <neldredge AT hmc DOT edu>
>wrote:
>
>>donho AT altern DOT org (Don HO) writes:
>>
>>> But it doesn't work with this one :
>>>
>>> #include <iostream>
>
> using namespace std;
>
>>> int main() {
>>> int x;
>>> cin >> x;
>>> cout << "Hello, World! I am " << x << " Today!" << endl;
>>> }
>>
>>Use the command `gpp' to compile C++, instead of `gcc'.
>
>That, and you forgot to `using' the `std' namespace.
>
>--
>Damian Yerrick
>"I refuse to listen to those who refuse to listen to reason."
>See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html
>
>This is McAfee VirusScan. Add these two lines to your signature to
>prevent the spread of signature viruses. http://www.mcafee.com/
Je bouffe donc je chie
- Raw text -