Solved

STL and MSVC++ v5.0 colide at iostream

Posted on 1998-08-31
9
296 Views
Last Modified: 2013-12-14
I am using STL (MSDEV) with the Microsoft Visual C++ Ver 5.0, and since it was introduced to my project I have problems with things like fopen and stuff. I tried to look deeper in the process, and found out that lower-level functions still work - _open returns a handler, but the upper level fopen receives a NULL.
I looked through the available net documentation about the MSVC++ and STL (actually for ver 4.2 but most of it stands for early releases of ver 5.0) and tried what I found: I changed the include of iosream.h to iostream (using namespace std); I switced the 'istream_iterator' lines in the istream file. I even got rid of the anoying warnings.
Still nothing.

Please help.

Tarbush
0
Comment
Question by:tarbush
9 Comments
 
LVL 3

Expert Comment

by:danny_pav
ID: 1171698
what warnings do you get?  what do you try to do?  What happens?
0
 

Author Comment

by:tarbush
ID: 1171699
to Danny_pav:
The comment I get is the usual ....4786.
It is removed with the #pragma directive.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1171700
I can assure you that these functions ussually do work.  This must be something you are doing wrong.  I would restore the original lines in the header files and try to see what the problem is.  Can you post your code?
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 1

Expert Comment

by:arbitrary
ID: 1171701
try applying sp2
it works better with templates and STL

0
 

Author Comment

by:tarbush
ID: 1171702
to arbitrary:

what is sp2?
thanks
0
 
LVL 22

Expert Comment

by:nietod
ID: 1171703
Can you post the relevant code?
0
 
LVL 2

Expert Comment

by:Paullkha
ID: 1171704
sp2 means service pack two. The most current I know of is service pack 3. Many files for C++, VB, and on, will be replaced with this service pack. If you download from the web, a T1 line would be nice since you will need 90megs+. (10megs per cab file)

Post the code, code is key!
0
 

Accepted Solution

by:
pstg earned 50 total points
ID: 1171705
You must "wrap" the #includes inside the std namespace, so there are no collision between Microsoft stuff and STL...

0
 

Author Comment

by:tarbush
ID: 1171706
to pstg:
what do you mean by "wrap"? If you are refering the stdio.h file - I used the <stdio> and not <stdio.h> (This is a documented MSVC++ 5.0 bug).

Please advice
thanks, tarbush
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question