User User name Password  
   
Wednesday 27.11.2024 / 00:32
Search AfterDawn Forums:        In English   Suomeksi   På svenska
afterdawn.com > forums > software, operating systems and more > linux - general discussion > kind of a newbi question about gcc (i think)
Show topics
 
Forums
Forums
Kind of a newbi question about gcc (I think)
  Jump to:
 
Posted Message
Venaqua
Junior Member
_
19. June 2008 @ 20:00 _ Link to this message    Send private message to this user   
So I switch from Windows to Ubuntu about a month or two ago and I thought it would make sense to learn some programing so I'm trying to learn C++ and, of course my first program is a Hello World one named Hello.cpp. The book I'm learning from says to type at the command prompt ~$cc Hello.cpp to compile it in MS-DOS.

So what I need to know is, for Linux would I type ~$gcc Hello.cpp. If not then what should I type and if so then why does this happen.

In file included from /usr/include/c++/4.2/backward/iostream.h:31,
from Hello.cpp:1:
/usr/include/c++/4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
/tmp/ccsOXpwT.o: In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Hello.cpp:(.text+0xe): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
Hello.cpp:(.text+0x59): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
Hello.cpp:(.text+0x97): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
Hello.cpp:(.text+0xdf): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
/tmp/ccsOXpwT.o: In function `main':
Hello.cpp:(.text+0x128): undefined reference to `std::cout'
Hello.cpp:(.text+0x12d): 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/ccsOXpwT.o: In function `__static_initialization_and_destruction_0(int, int)':
Hello.cpp:(.text+0x15d): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccsOXpwT.o: In function `__tcf_0':
Hello.cpp:(.text+0x1aa): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccsOXpwT.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

After this happens I don't get a program or any thing else.Could somebody please tell me what this means.
Also heres the program in case I made A mistake there (tho I don't think I did).

#include <iostream.h>

int main ()
{
cout<<"Hello, World\n";
return 0;
}

If somebody could help me I would really appreciate.
Venaqua
Junior Member
_
20. June 2008 @ 01:10 _ Link to this message    Send private message to this user   
Oops I didn't mean to make a second thread about this.

Can someone close this one.
This thread is closed and therefore you are not allowed reply to this thread.
afterdawn.com > forums > software, operating systems and more > linux - general discussion > kind of a newbi question about gcc (i think)
 

Digital video: AfterDawn.com | AfterDawn Forums
Music: MP3Lizard.com
Gaming: Blasteroids.com | Blasteroids Forums | Compare game prices
Software: Software downloads
Blogs: User profile pages
RSS feeds: AfterDawn.com News | Software updates | AfterDawn Forums
International: AfterDawn in Finnish | AfterDawn in Swedish | AfterDawn in Norwegian | download.fi
Navigate: Search | Site map
About us: About AfterDawn Ltd | Advertise on our sites | Rules, Restrictions, Legal disclaimer & Privacy policy
Contact us: Send feedback | Contact our media sales team
 
  © 1999-2024 by AfterDawn Ltd.

  IDG TechNetwork