Your browser does not seem to support CSS. If images appear below, please disregard them.
It appears that you're running an Ad-Blocker. This site is monetized by Advertising and by ">User Donations; we ask that if you find this site helpful that you whitelist us in your Ad-Blocker, or make a ">Donation to help aid in operating costs.
Previous Thread
Next Thread
Print Thread
Rate This Thread
#17140 - 06/15/06 08:42 AM a problem in c++ on red hat linux 9.0  
Joined: Jun 2006
Posts: 7
Linus Shen Offline
Junior Member
Linus Shen  Offline
Junior Member

Joined: Jun 2006
Posts: 7
China
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!


I just love it! KKK...
Sponsored Links
#17141 - 06/15/06 10:14 AM Re: a problem in c++ on red hat linux 9.0  
Joined: Jun 2006
Posts: 7
Linus Shen Offline
Junior Member
Linus Shen  Offline
Junior Member

Joined: Jun 2006
Posts: 7
China
o...somebody help me?...help~~~


I just love it! KKK...
#17142 - 06/15/06 09:49 PM Re: a problem in c++ on red hat linux 9.0  
Joined: Feb 2002
Posts: 7,202
Gremelin Offline
Community Owner
Gremelin  Offline

Community Owner

Joined: Feb 2002
Posts: 7,202
Likes: 11
Portland, OR; USA
Try:
g++ 1.cpp -o 1


Donate to UGN Security here.
UGN Security, Back of the Web, and VNC Web Services Owner
#17143 - 06/16/06 09:51 AM Re: a problem in c++ on red hat linux 9.0  
Joined: Jun 2006
Posts: 7
Linus Shen Offline
Junior Member
Linus Shen  Offline
Junior Member

Joined: Jun 2006
Posts: 7
China
OH YEAH!! I GOT IT!!
I have loved you....
THANKS!


I just love it! KKK...
#17144 - 06/17/06 06:09 AM Re: a problem in c++ on red hat linux 9.0  
Joined: Feb 2002
Posts: 7,202
Gremelin Offline
Community Owner
Gremelin  Offline

Community Owner

Joined: Feb 2002
Posts: 7,202
Likes: 11
Portland, OR; USA
No problems at all smile


Donate to UGN Security here.
UGN Security, Back of the Web, and VNC Web Services Owner
Sponsored Links
#17145 - 08/11/06 11:18 PM Re: a problem in c++ on red hat linux 9.0  
Joined: Mar 2002
Posts: 48
Scallion Offline
Junior Member
Scallion  Offline
Junior Member

Joined: Mar 2002
Posts: 48
iraq
instead of typing std:: everything, try a "using namespace std" after your # include's


Member Spotlight
Gremelin
Gremelin
Portland, OR; USA
Posts: 7,202
Joined: February 2002
Show All Member Profiles 
Forum Statistics
Forums45
Topics33,706
Posts68,856
Members2,166
Average Daily Posts1
Members2,166
Most Online1,567
Apr 25th, 2010
Latest Postings
The History Thread...
by Gremelin on 08/11/17 07:11 PM
my old account still exists!
by Gremelin on 08/11/17 07:02 PM
My friend NEEDS your HELP!
by Lena01 on 07/21/17 07:06 AM
I'm having fun with this guy.
by gabithompson730 on 07/20/17 08:50 AM
I want to upgrade my phone
by gabithompson730 on 07/20/17 08:49 AM
Newbie here
by gabithompson730 on 07/20/17 08:46 AM
Blackbeard.....
by Gremelin on 01/14/17 07:03 PM
Top Posters(All Time)
UGN Security 41,392
Gremelin 7,202
§intå× 3,255
SilentRage 1,273
Ice 1,146
pergesu 1,136
Infinite 1,041
jonconley 955
Girlie 908
unreal 860
Top Liked Users (All Time)
§intå× Likes: 3
Black Beard Likes: 1
Cold Sunn Likes: 1
Crime Likes: 1
Cyrez Likes: 1
fleshwound Likes: 1
Ghost Likes: 2
Gremelin Likes: 12
Ice Likes: 1
ninjaneo Likes: 1
Top Liked Users (30 Days)
No Data Found