delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/29/06:00:53

From: Stephen Baker <sdbaker AT blue DOT weeg DOT uiowa DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: iostream.h and string.h problem
Date: Mon, 28 Oct 1996 23:17:53 -0600
Organization: The University of Iowa
Lines: 40
Message-ID: <Pine.A32.3.91.961028230336.21906A-100000-100000-100000-100000@green.weeg.uiowa.edu>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 961028190122 DOT 17468K-100000 AT is>
NNTP-Posting-Host: green.weeg.uiowa.edu
Mime-Version: 1.0
In-Reply-To: <Pine.SUN.3.91.961028190122.17468K-100000@is>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Mon, 28 Oct 1996, Eli Zaretskii wrote:
 
 On Sun, 27 Oct 1996, Stephen Baker wrote:
 
 > I have made all the changes that you suggested. Unfortunately, the 
 > results are the same. Strings are not recognized.
 
 No, the results are totally different: this time you see a genuine 
 compiler error message which quite rightfully tells you there is a bug in 
 your program:
 
 	src\\stars2.cc: In function `int main()':
 	src\\stars2.cc:7: `string' undeclared (first use this function)
 
 And the culprit is this line:
 
 	#include <string.h>
 
 It should say this instead:
 
 	#include <string>	* Strange?! This and -lstdcx works on my home
				* machine.

 or this:
 
 	#include <std/string.h>		* The machine at work needs this and 
					* -lstdcx to function right?!

	* The setup for both machines is supposed to be the same, 
	* although the hardware differs, somewhat.
 
 If you use source code from some C++ book, be sure to check that the 
 headers they mention are indeed what the program expects.  Since C++ has 
 no ANSI standard yet, some details may vary between different compilers 
 and even between different versions of the same compiler.

* Thanks again! All of my programs that contain strings are now compiling 
* properly. Now I can get started on that project thats due next Monday!

Steve

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019