Missing header files in VC.Net

D

Daniel

Hi,

While I compile my old C++ source in VC.Net, rebulild whole project,
there are always some header files are unvaliable like "fstream.h",
"Dxguide.h".....etc.

Did VC.Net remove the VC++'s headers? How can I get them back? Where
sould I put them in?


Thanks, Daniel
 
D

David Lowndes

While I compile my old C++ source in VC.Net, rebulild whole project,
there are always some header files are unvaliable like "fstream.h",
"Dxguide.h".....etc.

Daniel,

fstream.h is replaced by <fstream>.

I'm not familiar with dxguide.h - is it something that's distributed
as part of the Platform SDK or a 3'rd party library?

Dave
 
H

Hinet News

Hi, Dave,

Thanks, it now pass with <fstream>, but still stopped at :

//my source..........
ifstream inputFile( filename, ios::in | ios::binary | ios::nocreate );

How can I solve this problem?

Thanks.

Daniel
 
D

Daniel

Hi, Dave,

Thanks, it now pass with <fstream> included, but still stopped at,

//my source.....
ifstream inputFile( filename, ios::in | ios::binary | ios::nocreate );

How should I revise it?

Kind Regards,
Daniel
 
D

David Lowndes

Thanks said:
//my source.....
ifstream inputFile( filename, ios::in | ios::binary | ios::nocreate );

Daniel,

What's the compiler error?

I'd guess that you need to add:

using namespace std;

Dave
 
D

Daniel

Dave,
using namespace std;
Still not work. it says.....


f:\SourceCode\VC.NET\C++\3D\OpenGL\MilkShape3D\Alien_Ani\MilkshapeModel.cpp(
118): error C2039: 'nocreate' : not memeber of
'std::basic_ios<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
f:\SourceCode\VC.NET\C++\3D\OpenGL\MilkShape3D\Alien_Ani\MilkshapeModel.cpp(
118): error C2065: 'nocreate' : Undeclared ...
f:\SourceCode\VC.NET\C++\3D\OpenGL\MilkShape3D\Alien_Ani\MilkshapeModel.cpp(
120): error C2065: 'cerr' : Undeclared ...
f:\SourceCode\VC.NET\C++\3D\OpenGL\MilkShape3D\Alien_Ani\MilkshapeModel.cpp(
143): error C2664: 'std::basic_istream<_Elem,_Traits>::read' : can not
change param 1 from 'byte *' to 'char *'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
..........
...........
.......... and many the similar.......



Daniel
 
D

Daniel

Dave,

Warnning messages now has only three while I adding the following ....
#include "platform.h"
#include "MilkshapeModel.h"


#include <iostream>
#include <fstream>
#include <ostream>
#include <istream>
using namespace std;

Warnning Message.......
f:\SourceCode\VC.NET\C++\3D\OpenGL\MilkShape3D\Alien_Ani\MilkshapeModel.cpp(
126): error C2039: 'nocreate' : not member of
'std::basic_ios<_Elem,_Traits>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
f:\SourceCode\VC.NET\C++\3D\OpenGL\MilkShape3D\Alien_Ani\MilkshapeModel.cpp(
126): error C2065: 'nocreate' : Undeclared Item
f:\SourceCode\VC.NET\C++\3D\OpenGL\MilkShape3D\Alien_Ani\MilkshapeModel.cpp(
151): error C2664: 'std::basic_istream<_Elem,_Traits>::read' : Can not
change parameter 1 from 'byte *' to 'char *'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]


Thanks,

Daniel
 
D

David Lowndes

Daniel,

Have a look at the MSDN topic titled "Differences in iostream
Implementation". ios::nocreate and others no longer exist. I'm not
sure what you're meant to use instead as I rarely use stream file I/O.

Dave
 
B

Bo Persson

David Lowndes said:
Daniel,

Have a look at the MSDN topic titled "Differences in iostream
Implementation". ios::nocreate and others no longer exist. I'm not
sure what you're meant to use instead as I rarely use stream file I/O.

Dave

You are not supposed to use anything, as 'nocreate' is what happens to
ios::in type of files. They are required to exist when you (or the
constructor) call open!


Bo Persson
 
D

Daniel

Hi, All,

Thanks, it works fine now.

I remove " ios::nocreate" from
ifstream inputFile( filename, ios::in | ios::binary |
ios::nocreate );
and add typecast (char *) before (byte *) variable.

Thanks again.

Kind regards,
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top