From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9502 invoked by alias); 10 May 2004 14:00:15 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 7492 invoked from network); 10 May 2004 13:58:55 -0000 Received: from unknown (HELO monty-python.gnu.org) (199.232.76.173) by sourceware.org with SMTP; 10 May 2004 13:58:55 -0000 Received: from [198.60.22.202] (helo=mgr2.xmission.com) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BN9nd-000524-At for gcc-help@gcc.gnu.org; Mon, 10 May 2004 08:22:25 -0400 Received: from [198.60.22.201] (helo=mgr1.xmission.com) by mgr2.xmission.com with esmtp (Exim 3.35 #1) id 1BN9nS-0002rp-02; Mon, 10 May 2004 06:22:14 -0600 Received: from [198.60.22.20] (helo=xmission.xmission.com) by mgr1.xmission.com with esmtp (Exim 4.30) id 1BN9nR-0006xx-Si; Mon, 10 May 2004 06:22:13 -0600 Received: from llewelly by xmission.xmission.com with local (Exim 3.35 #1 (Debian)) id 1BN9nR-0006mL-00; Mon, 10 May 2004 06:22:13 -0600 To: yuki shimada Cc: gcc-help@gcc.gnu.org References: <1084150900.3452.12.camel@localhost.localdomain> From: llewelly@xmission.com Date: Mon, 10 May 2004 14:00:00 -0000 In-Reply-To: <1084150900.3452.12.camel@localhost.localdomain> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Subject: Re: Is this bug in g++ /gcc-3.4.0 ? Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on mgr1.xmission.com X-Spam-Level: X-Spam-Status: No, hits=0.3 required=8.0 tests=NO_REAL_NAME autolearn=no version=2.63 X-SA-Exim-Mail-From: llewelly@xmission.com X-SA-Exim-Version: 3.1 (built Wed Aug 20 09:38:54 PDT 2003) X-SA-Exim-Scanned: Yes X-SW-Source: 2004-05/txt/msg00097.txt.bz2 yuki shimada writes: > Hollo! > I am Yuki Shimada. > This time , I had installed gcc-3.4.0 into my RedHat9. > And then,I had compiled "hello.cc" by using "g++". But cannot excute > "./a.out". Compiler tells me a error. > (Incase of "hellp.c" complied by "gcc", "./a.out" can excute well.) > > #1 error from g++ > [yuki@localhost c++]$ g++ hello.cc > [yuki@localhost c++]$ ./a.out > ./a.out: error while loading shared libraries: libstdc++.so.6: cannot > open shared object file: No such file or directory You need to tell your linker-loader where to find libstdc++.so.6 . Use 'man ld.so' to read about the linker-loader. By default, gcc will install libstdc++.so.6 into /usr/local/lib . If you configured gcc with --prefix, it will be in $prefix/local/lib . If you don't know where libstdc++.so.6 is, $ find / -iname 'libstdc++.so.6' -print will tell you where it is. Once you know where libstdc++.so.6 is, you can use ldconfig or LD_LIBRARY_PATH to tell the linker-loader where it is. Use 'man ldconfig' and 'man ld.so.conf' to read about ldconfig . Usually: # echo /usr/local/lib >> /etc/ld.so.conf # ldconfig (run as root) is correct. If libstdc++.so.6 is not in /usr/local/lib, replace '/usr/local/lib' with the directory containing libstdc++.so.6 . To use LD_LIBRARY_PATH, set it as an environment variable: in bash: $ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH in csh: > setenv LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH Again, if libstdc++.so.6 is not in /usr/local/lib, replace it with the directory containing libstdc++.so.6 . > #2 my source code: see attachment of this mail. > Is this a bug ? It's not a bug. Thank you for providing more information.