473,624 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3718
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
3911
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 make it easier for someone (i.e. a Microsoft person) to digest the information and respond to it. I am a C++ and Java developer with over 3 years of industry experience. I've written low level C++ code, in addition to web clients that use web...
6
3196
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
6478
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 <fstream> using namespace std;
3
7107
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 compile VS .net chucks out errors, lots of them: c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstdio(17) : error C2143: syntax error : missing '{' before ':' c:\Program Files\Microsoft Visual Studio .NET
1
7472
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 a bunch of "missing ;" errors. I did reinstall the whole thing a few times but it didn't work. Anyone have any idea? Thanks c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(862) :
2
2819
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 replace with the two lines: #include "stdafx.h" #include <vcclr.h> 5) Build->Build Solution I get the following compilation errors:
4
4835
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 * argv) { printf("hello world"); return 0;
0
1978
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' comes, followed by the 64 bit compilation of the IDl file. The comlpilation goes thro' the full stage and then the StdAfx.cpp is compiled. I have another similar VC 6 COM dll code that gets compiled without invoking the 64 bit processing of the...
16
5030
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: <%@ Application Codebehind="Global.asax.vb" Inherits="<Namespace>." %> I've done a lot of things I've found on the web to no avial, but here are some unique things about what is happening to me.
0
8249
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8493
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1493
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.