Bug 75546 - STL String will not properly compile
Summary: STL String will not properly compile
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: libstdc++
Version: 8.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-09 19:29 UTC by Bill Swortwood
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-10-09 19:31:19 UTC
Embargoed:


Attachments (Terms of Use)
Preprocessor output (693.31 KB, text/plain)
2002-10-09 19:31 UTC, Bill Swortwood
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.