Well, I am getting into Linux, and decided to try to write a hello world app, for mthe tutorials on the site.
So, here is my code..
Code:
#include <iostream>
using namespace std;
int main()
{
cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
cin.get();
return 1;
}
So I try compiling it with GCC and I get...
Code:
fhqwhgads@ryan1:~/EtopacSoftware> gcc HelloWorld.cpp
/tmp/cc1ADmAR.o(.text+0x25): In function `main':
: undefined reference to `std::cout'
/tmp/cc1ADmAR.o(.text+0x2a): 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/cc1ADmAR.o(.text+0x35): In function `main':
: undefined reference to `std::cin'
/tmp/cc1ADmAR.o(.text+0x3a): In function `main':
: undefined reference to `std::basic_istream<char, std::char_traits<char> >::get()'
/tmp/cc1ADmAR.o(.text+0x66): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/cc1ADmAR.o(.text+0x95): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/cc1ADmAR.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
fhqwhgads@ryan1:~/EtopacSoftware> gcc HelloWorld.cpp
/tmp/ccZKk43V.o(.text+0x25): In function `main':
: undefined reference to `std::cout'
/tmp/ccZKk43V.o(.text+0x2a): 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/ccZKk43V.o(.text+0x35): In function `main':
: undefined reference to `std::cin'
/tmp/ccZKk43V.o(.text+0x3a): In function `main':
: undefined reference to `std::basic_istream<char, std::char_traits<char> >::get()'
/tmp/ccZKk43V.o(.text+0x66): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccZKk43V.o(.text+0x95): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccZKk43V.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
Any idea? I am not new to c++, just Linux.