473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

fstream & compilation in Visual C++ under .NET 2003

If I try to declare an object of type fstream (or ofstream), I run into a compilation error refering to an __something function or variable.

Please note, I am including <fstream>, not <fstream.h>. I do know that much.

Thanks in advance for any assistance.

John
Nov 16 '05 #1
3 3706
John R. Delaney wrote:
If I try to declare an object of type fstream (or ofstream), I run
into a compilation error refering to an __something function or
variable.

Please note, I am including <fstream>, not <fstream.h>. I do know
that much.

Thanks in advance for any assistance.


Please give some example code and/or the complete text of an error message.

-cd
Nov 16 '05 #2
The error message is "error C2061: syntax error: identifier '_DebugHeapTag'". It occurs when building the project's precompiled header file.

Once I realized this was not simply a case of some oversight on my part (e.g., the fopen "b" argument) or a known bug, I did build a ~10 line project focused on the problem. The error does not show up there. It could be that I have 1 of the 100's of build properties set differently in the test project than in the real project. If you can suggest any for me to fiddle with, I will.

I would take the more general approach of cutting down the real project until it was the minimum size that would produce the error but that could take a while. The real project runs ~200,000 SLOC with considerable interdependence among its many .h and .cpp files. If you can suggest something that would reduce the effort significantly, I will give it a try. Otherwise, I will simply use the C-style I/O functions (which work now), thanks to you.

Again with graditude and respect,

John Delaney

----- Carl Daniel [VC++ MVP] wrote: -----

John R. Delaney wrote:
If I try to declare an object of type fstream (or ofstream), I run
into a compilation error refering to an __something function or
variable.
Please note, I am including <fstream>, not <fstream.h>. I do know

that much.
Thanks in advance for any assistance.


Please give some example code and/or the complete text of an error message.

-cd
Nov 16 '05 #3
John R. Delaney wrote:
The error message is "error C2061: syntax error: identifier
'_DebugHeapTag'". It occurs when building the project's precompiled
header file.

Once I realized this was not simply a case of some oversight on my
part (e.g., the fopen "b" argument) or a known bug, I did build a ~10
line project focused on the problem. The error does not show up
there. It could be that I have 1 of the 100's of build properties set
differently in the test project than in the real project. If you can
suggest any for me to fiddle with, I will.

I would take the more general approach of cutting down the real
project until it was the minimum size that would produce the error
but that could take a while. The real project runs ~200,000 SLOC with
considerable interdependence among its many .h and .cpp files. If you
can suggest something that would reduce the effort significantly, I
will give it a try. Otherwise, I will simply use the C-style I/O
functions (which work now), thanks to you.


That's probably the better choice anyway - it'll be less work than retooling
a large codebase to use C++ streams. Unfortunately, I don't know of any
magic bullet for narrowing down a repro case other than the laborious method
you allude to. Checking the complete compiler options between your test
project and the production project is a reasonably simple thing to do and
might yield some answers, but I doubt it. More likely, the cause is a macro
that's interfering with the <iostream> header file somehow, so it's
dependent on exactly what's been included and in what order.

-cd
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Novice | last post by:
Hi all, I'm afraid this is the second posting of this information as I didn't get a response on the previous post. I will try to shorten my message (i.e. be more concise) in the hopes that it will...
6
by: Armando | last post by:
Hallo ! I habe some error in my programm,because i use <fstream.h>,I want to use <fstream> but i donīt know which fonctions i must modify in my program ? Thanks you for your help. Armando.
2
by: Javi | last post by:
Hi!. I'm trying to do something like this but results in lot of errors. Can anybody tell me how to do it (first of all I hope you can grasp my idea)?: myfile.cpp #include <iostream> #include...
3
by: Catweasel | last post by:
I'm new to C++ and have been chucked in at the deep-end. I have a C++ console app that works fine. All I want to do is write to file however as soon as I include the fstream library and try to...
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
2
by: Tommy Vercetti | last post by:
In Visual Studio .NET 2003, I do the following 1) File->New->Project 2) Visual C++ Projects->.NET->Windows Forms Application 3) Project->Add New Item->C++ File 4) Clear the new C++ file and...
4
by: nils | last post by:
Hi all, Recently I started migrating a gcc project to Visual Studio C++ (dotnet). The problem is that I cannot include any iostream header-file: #include <fstream> int main (int argc, char *...
0
by: Ganapathy | last post by:
I have COM dll code written in VC 6.0. When i tried compiling this code in VC 7, The MIDL cmpiler gets called twice. i.e. it initially compiles fully & immediately a line - 64 bit processing'...
16
by: thefritz_j | last post by:
We just converted our VS2003 1.1 VB web project (which was working fine) to VS2005 2.0 and now I get: Parser Error Message: Could not load type '<Namespace>.'. Source Error: Line 1: <%@...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.