B
ben
When I try to gcc the following Helloworld program:
#include <iostream>
int main()
{
using namespace std;
cout << "Hello, World!!\n";
return 0;
}
I got errors as follows:
C:\Documents and Settings\benben>gcc ben.cpp
C:\DOCUME~1\benben\LOCALS~1\Temp/ccojbaaa.o(.text+0x33):ben.cpp: undefined
refer
ence to `std::cout'
C:\DOCUME~1\benben\LOCALS~1\Temp/ccojbaaa.o(.text+0x38):ben.cpp: undefined
refer
ence to `std::basic_ostream<char, std::char_traits<char> >& std:
perator<<
<std
::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&,
char c
onst*)'
C:\DOCUME~1\benben\LOCALS~1\Temp/ccojbaaa.o(.text+0x64):ben.cpp: undefined
refer
ence to `std::ios_base::Init::Init()'
C:\DOCUME~1\benben\LOCALS~1\Temp/ccojbaaa.o(.text+0x83):ben.cpp: undefined
refer
ence to `std::ios_base::Init::~Init()'
What has happend? Could anyone help me?
#include <iostream>
int main()
{
using namespace std;
cout << "Hello, World!!\n";
return 0;
}
I got errors as follows:
C:\Documents and Settings\benben>gcc ben.cpp
C:\DOCUME~1\benben\LOCALS~1\Temp/ccojbaaa.o(.text+0x33):ben.cpp: undefined
refer
ence to `std::cout'
C:\DOCUME~1\benben\LOCALS~1\Temp/ccojbaaa.o(.text+0x38):ben.cpp: undefined
refer
ence to `std::basic_ostream<char, std::char_traits<char> >& std:
<std
::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&,
char c
onst*)'
C:\DOCUME~1\benben\LOCALS~1\Temp/ccojbaaa.o(.text+0x64):ben.cpp: undefined
refer
ence to `std::ios_base::Init::Init()'
C:\DOCUME~1\benben\LOCALS~1\Temp/ccojbaaa.o(.text+0x83):ben.cpp: undefined
refer
ence to `std::ios_base::Init::~Init()'
What has happend? Could anyone help me?