[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: c++ hello world help



Hello Kevin,

You might find this page interesting:
http://www.research.att.com/~bs/compilers.html

It talks about standard ISO C++ and compilers.
By the way, GCC sure is a good choice for learning (_and_ for much more!).

Cheers,
Sylvain.


On Wednesday 26 May 2004 09:47, Kevin Mark wrote:
KM> Hi D-u,
KM> I'm trying to get gcc to compile some basic c++ programs and I'm running
KM> into some probably some really basic setup mistakes.
KM> gcc works with C programs.
KM> but c++ programs cant find the libs.
KM> =====================================================
KM>
KM> ~/cpluscplus\% cat page23.cpp
KM> #include <iostream.h>
KM> int main() { cout << "Hello, World!\n"; return 0; }
KM>
KM> ~/cpluscplus\% g++ page23.cpp
KM> In file included from /usr/include/c++/3.3/backward/iostream.h:31,
KM> from page23.cpp:1:
KM>  /usr/include/c++/3.3/backward/backward_warning.h:32:2:
KM>  warning: #warning This file includes at least one
KM>  deprecated or antiquated header. Please consider using
KM>  one of the 32 headers found in section 17.4.1.2 of the
KM>  C++ standard. Examples include substituting the <X>
KM>  header for the <X.h> header for C++ includes, or
KM>  <sstream> instead of the deprecated header
KM>  <strstream.h>. To disable this warning use
KM>  -Wno-deprecated.
KM>  kevin@165.247.40.180/730/0 :~/cpluscplus\
KM> (this compiles)
KM>  ===========================================================
KM>  but
KM>  ==========================================================
KM> ~/cpluscplus\% gcc page23.cpp
KM>  In file included from /usr/include/c++/3.3/backward/iostream.h:31,
KM>  from page23.cpp:1:
KM>   /usr/include/c++/3.3/backward/backward_warning.h:32:2:
KM>  warning: #warning This file includes at least one
KM>   deprecated or antiquated header. Please consider using
KM>   one of the 32 headers found in section 17.4.1.2 of the
KM>   C++ standard. Examples include substituting the <X>
KM>   header for the <X.h> header for C++ includes, or
KM>   <sstream> instead of the deprecated header
KM>   <strstream.h>. To disable this warning use
KM>   -Wno-deprecated.
KM>   /tmp/ccyxfHIz.o(.text+0x1b): In function `main':
KM>   : undefined reference to `std::cout'
KM>   /tmp/ccyxfHIz.o(.text+0x20): In function `main':
KM>   : undefined reference to `std::basic_ostream<char,
KM>   std::char_traits<char> >& std::operator<<
KM>   <std::char_traits<char> >(std::basic_ostream<char,
KM>   std::char_traits<char> >&, char const*)'
KM>   /tmp/ccyxfHIz.o(.text+0x49): In function
KM>   `__static_initialization_and_destruction_0(int, int)':
KM>   : undefined reference to
KM>   `std::ios_base::Init::Init[in-charge]()'
KM>   /tmp/ccyxfHIz.o(.text+0x7a): In function `__tcf_0':
KM>   : undefined reference to `std::ios_base::Init::~Init
KM>   [in-charge]()'
KM>   /tmp/ccyxfHIz.o(.eh_frame+0x11): undefined reference
KM>   to `__gxx_personality_v0'
KM>   collect2: ld returned 1 exit status
KM>   kevin@165.247.40.180/730/0 :~/cpluscplus\%
KM>   -----------------------------------------------------------
KM>   I installed libstdc++ and gcc versions 2.95,3.2,3.3
KM>   WHAT FILES DO I HAVE TO CONFIGURE OR INSTALL!
KM>   TIA
KM>   -Kev
KM>

-- 
Config (for wx-users):
- wx-2.4.2, 
- gcc 3.3.3, 
- GTK-2



Reply to: