public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hadmanysons at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/37671]  New: can't use iostream library
Date: Mon, 29 Sep 2008 02:45:00 -0000	[thread overview]
Message-ID: <bug-37671-16767@http.gcc.gnu.org/bugzilla/> (raw)

Whenever I try to compile something using the iostream library, gcc pumps out a
lot of errors. Here's the gcc -v -save-temps screen: 
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-cpu=generic --build=i386-redhat-linux
Thread model: posix
gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) 

Here's the errors i get get when compile (gcc src/mycode.cpp -o bin/myprog):
 gcc src/reg.cpp -o bin/reg
/tmp/cc8kjHpW.o: In function `main':
reg.cpp:(.text+0x1c): undefined reference to `std::cout'
reg.cpp:(.text+0x21): 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*)'
reg.cpp:(.text+0x29): undefined reference to `std::basic_ostream<char,
std::char_traits<char> >& std::endl<char, std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&)'
reg.cpp:(.text+0x31): undefined reference to `std::basic_ostream<char,
std::char_traits<char> >::operator<<(std::basic_ostream<char,
std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char>
>&))'
/tmp/cc8kjHpW.o: In function `__static_initialization_and_destruction_0(int,
int)':
reg.cpp:(.text+0x60): undefined reference to `std::ios_base::Init::Init()'
reg.cpp:(.text+0x65): undefined reference to `std::ios_base::Init::~Init()'
/tmp/cc8kjHpW.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

I know your page said you didn't want a code snippet but I can't help but think
it's relevant (I might just be overlooking something):

#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
  std::cout<<"asdf"<<endl;
  return 0;
}


Even something that simple won't work.


-- 
           Summary: can't use iostream library
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hadmanysons at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37671


             reply	other threads:[~2008-09-29  2:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29  2:45 hadmanysons at gmail dot com [this message]
2008-09-29  2:56 ` Andrew Thomas Pinski
2008-09-29  2:57 ` [Bug c++/37671] " pinskia at gmail dot com
2008-09-29 10:45 ` paolo dot carlini at oracle dot com
2008-09-29 14:37 ` hadmanysons at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-37671-16767@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).