Problem in Building C++ prgms. [message #100091] |
Mon, 19 April 2004 01:04  |
Eclipse User |
|
|
|
Hello all,
Given below is the C++ program and the C-Build (compiler o/p) for the same.
Loop.cpp
--------
#include<iostream.h>
int main() {
return 0;
}
C-Build Output:
--------------
make -k all
gcc -g -c loop.cpp
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from loop.cpp:1:
/usr/include/c++/3.2.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 <sstream> instead of the deprecated header
<strstream.h>. To disable this warning use -Wno-deprecated.
gcc -o loop loop.o
loop.o(.text+0x36): In function
`__static_initialization_and_destruction_0':
/usr/include/c++/3.2.2/iostream:63: undefined reference to
`std::ios_base::Init::Init[in-charge]()'
loop.o(.text+0x65): In function `__tcf_0':
/usr/include/c++/3.2.2/iostream:63: undefined reference to
`std::ios_base::Init::~Init [in-charge]()'
loop.o(.eh_frame+0x11): In function `main':
/home/smruthi/eclipse/eclipse/workspace/monday_19/loop.cpp:4 : undefined
reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [loop] Error 1
make: Target `all' not remade because of errors.
------------------------------------------------------------ -------------------
Someone help me to come out this basic stuff..
Thanks in advance.
Ragav
|
|
|
Re: Problem in Building C++ prgms. [message #100148 is a reply to message #100091] |
Mon, 19 April 2004 04:35  |
Eclipse User |
|
|
|
See your other thread, and btw. one thread should be enough for the same
problem! (C++-Project vs. C-Project)
Ragav wrote:
> Hello all,
>
> Given below is the C++ program and the C-Build (compiler o/p) for the same.
>
> Loop.cpp
> --------
> #include<iostream.h>
^^^^^^^^^^^^
This form is deprecated (as the warning below says), and the
extensionless headers should be used now. For std-C headers like stdio.h
there is an extensionless equivalent with a 'c'-prefix, if you really
need C headers in C++.
#include <iostream>
and/or
#include <cstdio>
>
> int main() {
> return 0;
> }
>
> C-Build Output:
> --------------
> make -k all
> gcc -g -c loop.cpp
> In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
> from loop.cpp:1:
> /usr/include/c++/3.2.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 <sstream> instead of the deprecated header
> <strstream.h>. To disable this warning use -Wno-deprecated.
> gcc -o loop loop.o
> loop.o(.text+0x36): In function
> `__static_initialization_and_destruction_0':
> /usr/include/c++/3.2.2/iostream:63: undefined reference to
> `std::ios_base::Init::Init[in-charge]()'
> loop.o(.text+0x65): In function `__tcf_0':
> /usr/include/c++/3.2.2/iostream:63: undefined reference to
> `std::ios_base::Init::~Init [in-charge]()'
> loop.o(.eh_frame+0x11): In function `main':
> /home/smruthi/eclipse/eclipse/workspace/monday_19/loop.cpp:4 : undefined
> reference to `__gxx_personality_v0'
> collect2: ld returned 1 exit status
> make: *** [loop] Error 1
> make: Target `all' not remade because of errors.
> ------------------------------------------------------------ -------------------
>
> Someone help me to come out this basic stuff..
>
> Thanks in advance.
> Ragav
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03874 seconds