Problem porting from VC6 to VS.net

S

slarti

My VS6 version used

#include <fstream.h>

which for VS.net I had to change to

#include <fstream>
using namespace std;

Now I get a compiler error :
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\fstream(465)
: error C2061: syntax error : identifier '_DebugHeapTag'

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\fstream(457)
: while compiling class-template member function 'void
std::basic_filebuf said:
::_Cvt *)'

with

[

_Elem=char,

_Traits=std::char_traits<char>

]

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\fstream(484)
: see reference to class template instantiation
'std::basic_filebuf<_Elem,_Traits>' being compiled

with

[

_Elem=char,

_Traits=std::char_traits<char>

]

Can anyone tell me how to fix it?



Thanks

DaveB
 
G

Guest

Not very sure to be usefull, but first, press F1 after left clicking at the
Output line in the one precising the error code to activate MSDN in this
context (precised by a error code in general), second, I've got not that far
(similar) errors porting from the same compilators with fstream templates,
sometimes I fixed it by myself sometimes I've gone back to C FILE* struct,
not glorious but robust and time saving.
Good luck
Xav

slarti said:
My VS6 version used

#include <fstream.h>

which for VS.net I had to change to

#include <fstream>
using namespace std;

Now I get a compiler error :
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\fstream(465)
: error C2061: syntax error : identifier '_DebugHeapTag'

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\fstream(457)
: while compiling class-template member function 'void
std::basic_filebuf said:
::_Cvt *)'

with

[

_Elem=char,

_Traits=std::char_traits<char>

]

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\fstream(484)
: see reference to class template instantiation
'std::basic_filebuf<_Elem,_Traits>' being compiled

with

[

_Elem=char,

_Traits=std::char_traits<char>

]

Can anyone tell me how to fix it?



Thanks

DaveB
 
C

Carl Daniel [VC++ MVP]

slarti said:
My VS6 version used

#include <fstream.h>

which for VS.net I had to change to

#include <fstream>
using namespace std;

Now I get a compiler error :
Can anyone tell me how to fix it?

If you can post a bit more code - ideally a complete .cpp file that you
think should compile but which does not.

-cd
 
N

Nikola Dudar [MSFT]

Most likely you have a project with several files that include mix of
CRT/MFC headers. What happens that you are including some CRT headers that
defined one mode of compilation, when in other headers define another mode
of compilation. You can play with how you headers are included and narrow
down the problem. However in most cases it is simpler and faster to just
move #include <fstream> to the top of stdafx.h, before other includes. This
shoud fix the problem.

Nikola

--
Nikola Dudar
Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Suggestions? Bugs? Feedback? Talk directly to dev teams using
http://lab.msdn.microsoft.com/productfeedback/


slarti said:
My VS6 version used

#include <fstream.h>

which for VS.net I had to change to

#include <fstream>
using namespace std;

Now I get a compiler error :
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\fstream(465)
: error C2061: syntax error : identifier '_DebugHeapTag'

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\fstream(457)
: while compiling class-template member function 'void
std::basic_filebuf said:
::_Cvt *)'

with

[

_Elem=char,

_Traits=std::char_traits<char>

]

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\fstream(484)
: see reference to class template instantiation
'std::basic_filebuf<_Elem,_Traits>' being compiled

with

[

_Elem=char,

_Traits=std::char_traits<char>

]

Can anyone tell me how to fix it?



Thanks

DaveB
 

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