From owner-freebsd-hackers Mon May 12 01:49:44 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id BAA07031 for hackers-outgoing; Mon, 12 May 1997 01:49:44 -0700 (PDT) Received: from labs.usn.blaze.net.au (labs.usn.blaze.net.au [203.17.53.30]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id BAA07025 for ; Mon, 12 May 1997 01:49:39 -0700 (PDT) Received: from labs.usn.blaze.net.au (local [127.0.0.1]) by labs.usn.blaze.net.au (8.8.5/8.8.5) with ESMTP id SAA03667; Mon, 12 May 1997 18:48:49 +1000 (EST) Message-Id: <199705120848.SAA03667@labs.usn.blaze.net.au> To: Chris Coleman Cc: freebsd-hackers@freebsd.org Subject: Re: 3.0-050297-SNAP C++ Problem. In-reply-to: Your message of "Thu, 08 May 1997 13:32:23 MST." X-Face: (W@z~5kg?"+5?!2kHP)+l369.~a@oTl^8l87|/s8"EH?Uk~P#N+Ec~Z&@;'LL!;3?y Date: Mon, 12 May 1997 18:48:47 +1000 From: David Nugent Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I am writing a program in C++ and everything was working fine on FBSD > 2.1.7. Then when I upgraded to 3.0-SNAP my program wouldn't make. It > gave me linker errors missing things like "_cout" and the other C++ Stream > stuff. I removed the libg++.so.4.0 library temporarily and compiled the > program again. It compiled, but now when I try to declare a fstream > variable the program crashes and core dumps. Any help would be > appreciated. Put libg++.so.4.0 and add -lstdc++ to the command line. All you achieve by removing libg++.so.4.0 is to either link against the static version of the library or worse, an older version of libg++. davidn@labs[~]> cat fstest.cc // fstest.cc #include int main(void) { ofstream file("testing"); file << "Hello, this is a test" << endl; return 0; } davidn@labs[~]> gcc -O -o fstest fstest.cc -lstdc++ davidn@labs[~]> ls -lF fstest* -rwxr-xr-x 1 davidn davidn 13712 May 12 18:43 fstest* -rw-r--r-- 1 davidn davidn 141 May 12 18:42 fstest.cc davidn@labs[~]> ./fstest davidn@labs[~]> cat testing Hello, this is a test davidn@labs[~]> _ iostream used to be part of libg++, but has now moved to stdc++, along with all of the other c++ standard classes (mainly stl). Regards, David David Nugent - Unique Computing Pty Ltd - Melbourne, Australia Voice +61-3-9791-9547 Data/BBS +61-3-9792-3507 3:632/348@fidonet davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/