Re: c++ hello world help
On Wednesday 26 May 2004 22:07, Sylvain Vedrenne wrote:
SV> Hello Kevin,
SV>
SV> You might find this page interesting:
SV> http://www.research.att.com/~bs/compilers.html
<somewhat off topic C++ stuff>
And this page is really worth looking at!
http://www.research.att.com/~bs/bs_faq2.html#simple-program
</somewhat off topic C++ stuff>
Cheers,
Sylvain.
SV>
SV> It talks about standard ISO C++ and compilers.
SV> By the way, GCC sure is a good choice for learning (_and_ for much
more!). SV>
SV> Cheers,
SV> Sylvain.
SV>
SV>
SV> On Wednesday 26 May 2004 09:47, Kevin Mark wrote:
SV> KM> Hi D-u,
SV> KM> I'm trying to get gcc to compile some basic c++ programs and I'm
running SV> KM> into some probably some really basic setup mistakes.
SV> KM> gcc works with C programs.
SV> KM> but c++ programs cant find the libs.
SV> KM> =====================================================
SV> KM>
SV> KM> ~/cpluscplus\% cat page23.cpp
SV> KM> #include <iostream.h>
SV> KM> int main() { cout << "Hello, World!\n"; return 0; }
SV> KM>
SV> KM> ~/cpluscplus\% g++ page23.cpp
SV> KM> In file included from /usr/include/c++/3.3/backward/iostream.h:31,
SV> KM> from page23.cpp:1:
SV> KM> /usr/include/c++/3.3/backward/backward_warning.h:32:2:
SV> KM> warning: #warning This file includes at least one
SV> KM> deprecated or antiquated header. Please consider using
SV> KM> one of the 32 headers found in section 17.4.1.2 of the
SV> KM> C++ standard. Examples include substituting the <X>
SV> KM> header for the <X.h> header for C++ includes, or
SV> KM> <sstream> instead of the deprecated header
SV> KM> <strstream.h>. To disable this warning use
SV> KM> -Wno-deprecated.
SV> KM> kevin@165.247.40.180/730/0 :~/cpluscplus\
SV> KM> (this compiles)
SV> KM> ===========================================================
SV> KM> but
SV> KM> ==========================================================
SV> KM> ~/cpluscplus\% gcc page23.cpp
SV> KM> In file included from /usr/include/c++/3.3/backward/iostream.h:31,
SV> KM> from page23.cpp:1:
SV> KM> /usr/include/c++/3.3/backward/backward_warning.h:32:2:
SV> KM> warning: #warning This file includes at least one
SV> KM> deprecated or antiquated header. Please consider using
SV> KM> one of the 32 headers found in section 17.4.1.2 of the
SV> KM> C++ standard. Examples include substituting the <X>
SV> KM> header for the <X.h> header for C++ includes, or
SV> KM> <sstream> instead of the deprecated header
SV> KM> <strstream.h>. To disable this warning use
SV> KM> -Wno-deprecated.
SV> KM> /tmp/ccyxfHIz.o(.text+0x1b): In function `main':
SV> KM> : undefined reference to `std::cout'
SV> KM> /tmp/ccyxfHIz.o(.text+0x20): In function `main':
SV> KM> : undefined reference to `std::basic_ostream<char,
SV> KM> std::char_traits<char> >& std::operator<<
SV> KM> <std::char_traits<char> >(std::basic_ostream<char,
SV> KM> std::char_traits<char> >&, char const*)'
SV> KM> /tmp/ccyxfHIz.o(.text+0x49): In function
SV> KM> `__static_initialization_and_destruction_0(int, int)':
SV> KM> : undefined reference to
SV> KM> `std::ios_base::Init::Init[in-charge]()'
SV> KM> /tmp/ccyxfHIz.o(.text+0x7a): In function `__tcf_0':
SV> KM> : undefined reference to `std::ios_base::Init::~Init
SV> KM> [in-charge]()'
SV> KM> /tmp/ccyxfHIz.o(.eh_frame+0x11): undefined reference
SV> KM> to `__gxx_personality_v0'
SV> KM> collect2: ld returned 1 exit status
SV> KM> kevin@165.247.40.180/730/0 :~/cpluscplus\%
SV> KM> -----------------------------------------------------------
SV> KM> I installed libstdc++ and gcc versions 2.95,3.2,3.3
SV> KM> WHAT FILES DO I HAVE TO CONFIGURE OR INSTALL!
SV> KM> TIA
SV> KM> -Kev
SV> KM>
SV>
SV> --
SV> Config (for wx-users):
SV> - wx-2.4.2,
SV> - gcc 3.3.3,
SV> - GTK-2
SV>
SV>
--
Config (for wx-users):
- wx-2.4.2,
- gcc 3.3.3,
- GTK-2
Reply to: