Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

Problem porting from VC6 to VS.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
slarti - 04 Mar 2005 23:18 GMT
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<_Elem,_Traits>::_Initcvt(std::basic_filebuf<_Elem,_Traits
>::_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
sergega4@yahoo.fr - 07 Mar 2005 01:29 GMT
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  

> My VS6 version used
>
[quoted text clipped - 43 lines]
>
> DaveB
Carl Daniel [VC++ MVP] - 07 Mar 2005 01:55 GMT
> My VS6 version used
>
[quoted text clipped - 7 lines]
> 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
Nikola Dudar [MSFT] - 10 Mar 2005 03:06 GMT
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

Signature

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/

> My VS6 version used
>
[quoted text clipped - 46 lines]
>
> DaveB

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.