473,569 Members | 2,590 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fatal error C1001: INTERNAL COMPILER ERROR

Compiling...
overlaod.cpp
d:\vc work\cpp\think_ in_cpp\chapter1 0\overlaod.cpp( 17) : fatal error
C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.

overlaod.obj - 1 error(s), 0 warning(s)

when compiling, errors above will apear.I am a newbie in C++, I hope
someone here can help me.Following is my source code

#include <iostream>

using namespace std;

class myOverload
{
public:
myOverload(floa t a, float b)
{
x = a;
y = b;
}
myOverload operator=(const myOverload qq)
{
return myOverload(x = qq.x, y = qq.y);
}
friend const myOverload operator+(const myOverload &m, const
myOverload &n);
void myprint()
{
cout << "here is a complex: \n" << x << "+" << y << "i" << endl;
}
private:
float x;
float y;
};

myOverload const operator+(const myOverload &m, const myOverload &n)
{
return myOverload(m.x + n.x, m.y + n.y);
}

int main()
{
myOverload AA(1.3f, 2.6f);
myOverload BB(1.7f, 0.4f);
myOverload CC = AA + BB;
CC.myprint();

return 0;
}

Apr 19 '06 #1
10 8983
LZXIA wrote:
Compiling...
overlaod.cpp
d:\vc work\cpp\think_ in_cpp\chapter1 0\overlaod.cpp( 17) : fatal error
C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.

overlaod.obj - 1 error(s), 0 warning(s)

when compiling, errors above will apear.I am a newbie in C++, I hope
someone here can help me.Following is my source code
Internal error usually has nothing to do with your code. Try to compile
a minimum program (ie. int main(){}) and see if the error persist. You
might need to reinstall your compiler.

#include <iostream>

using namespace std;

class myOverload
{
public:
myOverload(floa t a, float b)
{
x = a;
y = b;
}
myOverload operator=(const myOverload qq)
{
return myOverload(x = qq.x, y = qq.y);
}
friend const myOverload operator+(const myOverload &m, const
myOverload &n);
void myprint()
{
cout << "here is a complex: \n" << x << "+" << y << "i" << endl;
}
private:
float x;
float y;
};

myOverload const operator+(const myOverload &m, const myOverload &n)
{
return myOverload(m.x + n.x, m.y + n.y);
}

int main()
{
myOverload AA(1.3f, 2.6f);
myOverload BB(1.7f, 0.4f);
myOverload CC = AA + BB;
CC.myprint();

return 0;
}


Your code compiled fine with both g++ and cl on my machine.

Regards,
Ben
Apr 19 '06 #2
I think there must be some probelm in my VC6.0. Thanks.

Apr 19 '06 #3
LZXIA wrote:
I think there must be some probelm in my VC6.0. Thanks.

Many! It's also very old.

--
Ian Collins.
Apr 19 '06 #4
"LZXIA" writes:
Compiling...
overlaod.cpp
d:\vc work\cpp\think_ in_cpp\chapter1 0\overlaod.cpp( 17) : fatal error
C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.

overlaod.obj - 1 error(s), 0 warning(s)

when compiling, errors above will apear.I am a newbie in C++, I hope
someone here can help me.Following is my source code

#include <iostream>

using namespace std;

class myOverload
{
public:
myOverload(floa t a, float b)
{
x = a;
y = b;
}
myOverload operator=(const myOverload qq)
{
return myOverload(x = qq.x, y = qq.y);
}
friend const myOverload operator+(const myOverload &m, const
myOverload &n);
void myprint()
{
cout << "here is a complex: \n" << x << "+" << y << "i" << endl;
}
private:
float x;
float y;
};

myOverload const operator+(const myOverload &m, const myOverload &n)
{
return myOverload(m.x + n.x, m.y + n.y);
}

int main()
{
myOverload AA(1.3f, 2.6f);
myOverload BB(1.7f, 0.4f);
myOverload CC = AA + BB;
CC.myprint();

return 0;
}


It compiles and runs OK for me on DevC. Prints 3 + 3i. It looks like your
problem has something to do with VC.

FWIW note that C and C++ programmers rarely use float, they almost always
use double. If they had a huge matrix they might put it in external storage
as a float but re-fluff it when they went to use it. The transcendental
functions and such like work on double.

If I were in your place, I would tuck the problem in the back of my mind and
go on about my business
Apr 19 '06 #5
> Compiling...
overlaod.cpp
d:\vc work\cpp\think_ in_cpp\chapter1 0\overlaod.cpp( 17) : fatal error
C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.

overlaod.obj - 1 error(s), 0 warning(s)

when compiling, errors above will apear.I am a newbie in C++, I hope
someone here can help me.Following is my source code


Your code compiled fine for me with vc6sp5. If you aren't able
to upgrade your compiler, you can at least get the service pack
which should help out some.
Apr 19 '06 #6
In message <6m************ *****@tornado.s ocal.rr.com>, pillbug
<_p******@socal .rr.com> writes
Compiling...
overlaod.cpp
d:\vc work\cpp\think_ in_cpp\chapter1 0\overlaod.cpp( 17) : fatal error
C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1786)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.
overlaod.obj - 1 error(s), 0 warning(s)
when compiling, errors above will apear.I am a newbie in C++, I hope
someone here can help me.Following is my source code


Your code compiled fine for me with vc6sp5. If you aren't able
to upgrade your compiler, you can at least get the service pack
which should help out some.


One possible cause of "internal compiler error" with VC++ is the wrong
kind of line separators - which obviously won't show up when other
people cut and paste from a news client to their compilers.

Was any of the code ported from a Unix system?

--
Richard Herring
Apr 19 '06 #7
One possible cause of "internal compiler error" with VC++ is the
wrong
kind of line separators - which obviously won't show up when other
people cut and paste from a news client to their compilers.


Now that helped me a lot with some old code I could not compile for
some stupid reason. Now it works, thanks a lot!
Apr 19 '06 #8
it probably doesn't like the friend function or the odd const, try this:

#include <iostream>

using namespace std;

class myOverload
{
public:
myOverload(floa t a, float b)
{
x = a;
y = b;
}
myOverload operator=(const myOverload & qq) //<<
{
return myOverload(x = qq.x, y = qq.y);
}
friend const myOverload operator+(const myOverload &m,
const myOverload &n);
void myprint()
{
cout << "here is a complex: \n" << x << "+" << y << "i"
<< endl;
}
private:
float x;
float y;
};

// or here with the odd const
myOverload /* const */ operator+(const myOverload &m, const myOverload &n)
{
return myOverload(m.x + n.x, m.y + n.y);
}

int main()
{
myOverload AA(1.3f, 2.6f);
myOverload BB(1.7f, 0.4f);
myOverload CC = AA + BB;
CC.myprint();

return 0;
}
Apr 19 '06 #9
LZXIA wrote:
I think there must be some probelm in my VC6.0. Thanks.


Probably. Ask in their groups, get a (free?) upgrade, and finally,
check
if your disk is full. VC6 chokes on that (it's not the only one, but
it's
rather unhelpful about it)

HTH
Michiel Salters

Apr 20 '06 #10

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

Similar topics

6
8609
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 build my gui and dll projects, whose project, workspace, source files all resided on network drive mapped to H. The H mapping,
0
1701
by: JimmyS | last post by:
I am getting this error .. c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stl_alloc.h(305) : fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 2701) when including any files for templates .. #include <fstream> , #include <string>, #include <vector>, #include <list> etc... The funny thing is...
9
15298
by: Marco Nova | last post by:
Hello I'm using the latest version of Visual Studio 2003 version 7.1.3088, .net framework 1.1.4322 and I've some problem compiling a project, it give me the error c:\build\main\.....\methodeInc.h(36) : fatal error C1001: INTERNAL COMPILER ERRO (compiler file 'msc1.cpp', line 2701) Please choose the Technical Support command on the Visual...
10
3259
by: PufferFish | last post by:
Hi folks, I hope that this is the correct group for these things, apologies if not. I've got a strange compiler error. It appears to be similar to the issue described in knowledgebase article 320004 except that particular problem was
4
3041
by: cgparis | last post by:
Dear forum members, I am trying to compile C++ code under MS Visual Studio .NET 2003, which references the latest Xerces C++ release library (2.6.0). This Xerces release was made available recently by the Apache organization. I've defined a system variable on windows as follows: XERCESCROOT: <...>\xerces-c_2_6_0-windows_nt-msvc_60
2
2942
by: Itjalve | last post by:
This gives me a fatal error. I'm using .NET VC7.1 and made a win32 consol app, I have no problems with VC6. Debug build. I have removed nearly all my code this is whats left. From the beginning the template was defined in a .h file, but that has no effect, same error. I have seen when searching for fatal error that there are some problems...
4
5636
by: ARF | last post by:
I'm testing AutoCAD 2005 automation via VS2005 Pro C++/CLR and I'm getting fatal compiler errors. I start with a default C++/CLR class library project and modify it by adding the following references: acdbmgd.dll acmgd.dll the entire source for the default library header file is:
1
2483
by: ishbuu | last post by:
Hi all. I've been trying to get a program I wrote on my old machine to compile on this one, but VS2k5 hasn't been able to finish the thing. I was using the same operating system/hardware/version on my old machine, I just replaced the Harddrives after my old one with the OS failed. No matter how many tweaks I make to the build setup it...
1
3754
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 linux box using rsh it gives me the errors below Microsoft (R) Development Environment Version 7.10.3077. Copyright (C) Microsoft Corp...
1
9499
by: Anonymous | last post by:
My code has suddenly stopped compiling after some refactoring I carried out last week. I am using VC8 on W2K professional I get the following cryptic error: Error 77 fatal error C1001: An internal error has occurred in the compiler. c:\program files\microsoft visual studio 8\vc\include\xmemory 155
0
7701
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...
0
8130
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...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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...
0
3653
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...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
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
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
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...

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.