| Author |
Message |
THE_ONE
Linux Bees

Joined: 25 Mar 2008 Posts: 26 Location: India |
|
Need help to compile the file in C++ in linux |
|
Hello all,
i am learning C++ on linux.
i have tried to compile very simple code "Fiert.cc"
 |
 |
1: #include <iostream.h>
2:
3: main()
4: {
5: float pi = 3.14;
6: cout << "The value of pi is " << pi << "\n";
7: return 0;
8: } |
when i compiled this code i am getting such warning msg.
 |
 |
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/backward/iostream.h:31,
from 1.cpp:1:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.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/ccYMN8qn.o: In function `__static_initialization_and_destruction_0(int, int)':
1.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccYMN8qn.o: In function `__tcf_0':
1.cpp:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccYMN8qn.o: In function `main':
1.cpp:(.text+0x96): undefined reference to `std::cout'
1.cpp:(.text+0x9b): 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*)'
1.cpp:(.text+0xac): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(float)'
1.cpp:(.text+0xbc): 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/ccYMN8qn.o: (.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status |
can any one please help me to solve this problem..??
_________________ with regards,
Hitesh D R |
|
| Mon May 05, 2008 10:31 am |
|
 |
rohan
Site Admin


Joined: 14 Mar 2008 Posts: 45 Location: India |
|
|
| Mon May 05, 2008 2:19 pm |
|
 |
THE_ONE
Linux Bees

Joined: 25 Mar 2008 Posts: 26 Location: India |
|
|
|
thank you so much rohan,
i have got the solution for that warnings.
BTW, i was able to see output in my last code also but the problem was warning.
it was appearing on every compilation.
any way thanks again.
i am uploading my updated code here. so other user like me can get idea from it.
 |
 |
#include <iostream>
main()
{
float pi = 3.14;
std::cout << "The value of pi is " << pi << "\n";
return 0;
} |
_________________ with regards,
Hitesh D R |
|
| Tue May 06, 2008 2:54 am |
|
 |
rohan
Site Admin


Joined: 14 Mar 2008 Posts: 45 Location: India |
|
|
|
well thnx for reply,
m happy that it helped u.
have a good day
_________________ With Regards,
Rohan Bhagat
==============
Surat Linux Users Group
http://www.suratlug.org
==============
"With Great Powers, Comes the Great Responsibility" |
|
| Tue May 06, 2008 7:56 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|