473,403 Members | 2,366 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,403 software developers and data experts.

INTERNAL Compiler error with VC 7.1 compiler

Hi,

I am trying to compile a code developed using VC6 in VC 7.1 compiler.

I get a "Internal compiler error" for what I think is a very simple
piece of code.

I tried to reproduce the problem and it is possible with the code below.

//------------------------------------
//ForwardDecl.h
//------------------------------------
class CString;
class Temp
{
public:
Temp(const CString& szStr);
};

//------------------------------------
//ForwardDecl.cpp
//------------------------------------
# include <afx.h>
# include "ForwardDecl.h"
int _tmain(int argc, _TCHAR* argv[])
{
CString szTemp;
Temp t(szTemp);
return 0;
}

It gives a ICE on line 1 of ForwardDecl.h.
Of course I can include <afx.h> in the ForwardDecl.h and get away with it.
But I don't want to unnecessarily include a header.
Is there any other solution?

Best Regards,
ravi.

PS: If you want to reply directly, pl. remove the .net from my mail address.
Sorry for the inconvenience!
Nov 16 '05 #1
3 1611

"Ravikiran" <ra*********@siemens.com.net> skrev i meddelandet
news:be**********@news.mch.sbs.de...
Hi,

I am trying to compile a code developed using VC6 in VC 7.1 compiler.
I get a "Internal compiler error" for what I think is a very simple
piece of code.

I tried to reproduce the problem and it is possible with the code below.
//------------------------------------
//ForwardDecl.h
//------------------------------------
class CString;
CString is no longer a class, but a typedef for a template. You cannot
forward declare it like this (probably not at all).
Bo Persson
bo**@telia.com

class Temp
{
public:
Temp(const CString& szStr);
};


Nov 16 '05 #2
"Bo Persson" <bo**@telia.com> wrote in message
news:OD**************@TK2MSFTNGP11.phx.gbl...
"Ravikiran" <ra*********@siemens.com.net> skrev i meddelandet
news:be**********@news.mch.sbs.de...

I get a "Internal compiler error" for what I think is a very simple
piece of code. <snip> class CString;


CString is no longer a class, but a typedef for a template. You cannot
forward declare it like this (probably not at all).


Yes, but the compiler shouldn't puke when it sees such a declaration; it
should give a reasonable error message. ICE is always a bug.

Ken
Nov 16 '05 #3
>> > I get a "Internal compiler error" for what I think is a very simple
> piece of code.<snip> > class CString;

Thanks for reporting this bug Ravi. We have already fixed this problem --
however it was too late for 7.1 compiler, so the fix will only appear in
the next version.

To avoid the ICE, remove forward declaration of CString -- you don't need
it if you include afx.h.
Yes, but the compiler shouldn't puke when it sees such a declaration; it
should give a reasonable error message. ICE is always a bug.


Correct -- ICE is always a bug.

Artur Laksberg,
Visual C++ Compiler Development Team
This posting is provided AS IS with no warranties, and confers no rights.

Nov 16 '05 #4

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

Similar topics

6
by: paul calvert | last post by:
I hope somewhere here has encountered and solved a similar problem in the past. 1) on a new Win2000 PC: installed Visual C++ 6.0 download & install single file Service Pack 5.0 2) try to...
30
by: Neil Zanella | last post by:
Hello, Allow me to share my frustrations with GNU g++. This is the second time something similar happens to me: I can't find anything wrong with my C++ program and yet I get segfaults, and...
16
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
1
by: Ayende Rahien | last post by:
reparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error (0xc0000005 at address 53168B12): likely culprit is 'BIND'. An internal...
4
by: David Sworder | last post by:
Consider the following line of code (it's not important what it does): resp.DocItem=Relations.SelectDocItems_BySearchString(req.SearchPhrase); It turns out that this line is in error. The...
19
by: Martin Oddman | last post by:
Hi, I have a compiling problem. Please take a look at the code below. I have an application that is built upon three tiers: one data tier (Foo.DataManager), one business tier (Foo.Kernel) and...
1
by: pj | last post by:
Oh, I forgot to list the error messages; I would be delighted if someone could explain how to deduce which line number in which file is the one that the VC compiler cannot handle. Actually I'm...
6
by: David Lack | last post by:
Hi, I recently installed a 60-day trial of .NET 2003 on my development system. I made tests with previous personal projects (which compiled ok with VC6) and some open source files, and keep...
0
by: Jim Heavey | last post by:
Internal Compiler Error: stage 'BEGIN' Hello, I had an application which was working just fine and I decided to modify all database access within the application to utilizie a new Namespace that I...
1
by: kvarada | last post by:
Hello Experts, I am building my application on WinNT.4.0_i386_MSVC.7.1 platform. When I build the application on a stand alone machine, it builds fine. But when I build the same application from a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.