Bug 75546

Summary: STL String will not properly compile
Product: [Retired] Red Hat Linux Reporter: Bill Swortwood <billiam>
Component: libstdc++Assignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-10-09 19:31:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Preprocessor output none

Description Bill Swortwood 2002-10-09 19:29:10 UTC
Description of Problem:


Version-Release number of selected component (if applicable):

Current 3.2 version on Red Hat 8.0 disk 


How Reproducible:

Very.


Steps to Reproduce:
1. 

In file test.cpp:

#include <cstdlib>
#include <string>
#include <cstring>
#include <iostream>


 main () {
        string * bob;

         bob = new string("stuff");
         cout << bob << endl;
         exit 0;
}


2. gcc -o mytest test.cpp 
3. 

Actual Results:
test.cpp: In function `int main()':
test.cpp:8: `string' undeclared (first use this function)
test.cpp:8: (Each undeclared identifier is reported only once for each function
   it appears in.)
test.cpp:8: `bob' undeclared (first use this function)
test.cpp:10: parse error before `(' token
test.cpp:11: `cout' undeclared (first use this function)
test.cpp:11: `endl' undeclared (first use this function)
test.cpp:12: parse error before numeric constant



Expected Results:

A compiled program, perhaps?

Additional Information:

This is a clean install of RH 8.0.

Comment 1 Bill Swortwood 2002-10-09 19:31:13 UTC
Created attachment 79684 [details]
Preprocessor output

Comment 2 Jakub Jelinek 2002-10-09 19:34:46 UTC
This is not a ISO C++ compliant source.
Please check /usr/share/doc/libstdc++-devel-3.2/
documentation. Either you can add using namespace std; after the includes,
or using std::string; using std::endl; etc., or use new std::string("foo");
etc. explictly.