Solved

STL and MSVC++ v5.0 colide at iostream

Posted on 1998-08-31
9
295 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
 
LVL 1

Expert Comment

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

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

862 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now