Solved

STL and MSVC++ v5.0 colide at iostream

Posted on 1998-08-31
9
292 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
C#  WebForms or MVC 4 89
thread-safe code in c++ 2 72
I could not build boost code, 10 52
Best book to learn C++ 4 53
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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…

759 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

18 Experts available now in Live!

Get 1:1 Help Now