P
Prasad
Hi All,
I am executing simple hello world program. But, getting compile time
errors.
What is the problem here?
prasad@D-T11673A:~/programs/c> cat bst.cpp
#include<iostream>
using namespace std;
int main ()
{
cout << "Hello World." ;
return 0 ;
}
prasad@D-T11673A:~/programs/c> gcc bst.cpp
/tmp/ccrmoRpD.o: In function `main':
bst.cpp.text+0x25): undefined reference to `std::cout'
bst.cpp.text+0x2a): undefined reference to `std::basic_ostream<char,
/tmp/ccrmoRpD.o: In function `__tcf_0':
bst.cpp.text+0x47): undefined reference to
`std::ios_base::Init::~Init()'
/tmp/ccrmoRpD.o: In function
`__static_initialization_and_destruction_0(int, int)':
bst.cpp.text+0x74): undefined reference to
`std::ios_base::Init::Init()'
/tmp/ccrmoRpD.o.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status
prasad@D-T11673A:~/programs/c> echo $?
1
Thanks & regards,
Prasad
I am executing simple hello world program. But, getting compile time
errors.
What is the problem here?
prasad@D-T11673A:~/programs/c> cat bst.cpp
#include<iostream>
using namespace std;
int main ()
{
cout << "Hello World." ;
return 0 ;
}
prasad@D-T11673A:~/programs/c> gcc bst.cpp
/tmp/ccrmoRpD.o: In function `main':
bst.cpp.text+0x25): undefined reference to `std::cout'
bst.cpp.text+0x2a): undefined reference to `std::basic_ostream<char,
std::char_traits said:(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccrmoRpD.o: In function `__tcf_0':
bst.cpp.text+0x47): undefined reference to
`std::ios_base::Init::~Init()'
/tmp/ccrmoRpD.o: In function
`__static_initialization_and_destruction_0(int, int)':
bst.cpp.text+0x74): undefined reference to
`std::ios_base::Init::Init()'
/tmp/ccrmoRpD.o.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status
prasad@D-T11673A:~/programs/c> echo $?
1
Thanks & regards,
Prasad