Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2006
Posts: 7
L
Junior Member
Junior Member
L Offline
Joined: Jun 2006
Posts: 7
here's the programme,1.cpp:

Code
 
#include<iostream> 
#include<string> 

int main() 
{ 
std::cout << "hello world" << std::endl; 
return(0);
} 
 
under the shell
$ gcc 1.cpp
and then appear too much unknown things~~

Code
 
/tmp/ccL80Lex.o(.text+0x14): In function `main': 
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' 
/tmp/ccL80Lex.o(.text+0x21): In function `main': 
: undefined reference to `std::cout' 
/tmp/ccL80Lex.o(.text+0x26): In function `main': 
: 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*)' 
/tmp/ccL80Lex.o(.text+0x2f): In function `main': 
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))' 
/tmp/ccL80Lex.o(.text+0x5c): In function `__static_initialization_and_destruction_0(int, int)': 
: undefined reference to `std::ios_base::Init::Init[in-charge]()' 
/tmp/ccL80Lex.o(.text+0x8b): In function `__tcf_0': 
: undefined reference to `std::ios_base::Init::~Init [in-charge]()' 
/tmp/ccL80Lex.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0' 
collect2: ld returned 1 exit status 
HELP ME! THANKS!

Sponsored Links
▼ Sponsored Links ▼ ▲ Sponsored Links ▲
Joined: Jun 2006
Posts: 7
L
Junior Member
Junior Member
L Offline
Joined: Jun 2006
Posts: 7
o...somebody help me?...help~~~

Joined: Feb 2002
Posts: 7,204
Likes: 11
Community Owner
Community Owner
Joined: Feb 2002
Posts: 7,204
Likes: 11
Try:
g++ 1.cpp -o 1


Donate to UGN Security here.
UGN Security, Back of the Web, and VNC Web Services Owner
Joined: Jun 2006
Posts: 7
L
Junior Member
Junior Member
L Offline
Joined: Jun 2006
Posts: 7
OH YEAH!! I GOT IT!!
I have loved you....
THANKS!

Joined: Feb 2002
Posts: 7,204
Likes: 11
Community Owner
Community Owner
Joined: Feb 2002
Posts: 7,204
Likes: 11
No problems at all smile


Donate to UGN Security here.
UGN Security, Back of the Web, and VNC Web Services Owner
Joined: Mar 2002
Posts: 48
S
Junior Member
Junior Member
S Offline
Joined: Mar 2002
Posts: 48
instead of typing std:: everything, try a "using namespace std" after your # include's


Link Copied to Clipboard
Member Spotlight
Gremelin
Gremelin
Portland, OR; USA
Posts: 7,204
Joined: February 2002
Forum Statistics
Forums41
Topics33,839
Posts68,797
Members2,177
Most Online73,244
Nov 9th, 2025
Latest Postings
Top Posters
UGN Security 41,392
Gremelin 7,204
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Likes Received
Ghost 2
Girlie 1
unreal 1
Crime 1
Ice 1
Dartur 1
Powered by UBB.threads™ PHP Forum Software 8.0.0