最近在看《深入浅出MFC》,但是在编译随书的源码时却总是出错;例如第二章的Flow.cpp:
#include <iostream.h>
#include <string.h>class CDemo
{
public:
CDemo(const char* str);
~CDemo();
private:
char name[20];
};CDemo::CDemo(const char* str)
{
strncpy(name, str, 20);
cout << "Constructor called for " << name << '\n';
}CDemo::~CDemo()
{
cout << "Destructor called for " << name << '\n';
}void func()
{
CDemo LocalObjectInFunc("LocalObjectInFunc"); // in stack
static CDemo StaticObject("StaticObject"); // local static
CDemo* pHeapObjectInFunc = new CDemo("HeapObjectInFunc"); // in heap cout << "Inside func" << endl;}CDemo GlobalObject("GlobalObject"); // global staticvoid main()
{
CDemo LocalObjectInMain("LocalObjectInMain"); // in stack
CDemo* pHeapObjectInMain = new CDemo("HeapObjectInMain"); // in heap cout << "In main, before calling func\n";
func();
cout << "In main, after calling func\n";}
出错提示是:
Compiling...
Flow.cpp
e:\深入浅出 mfc\dissect\flow.02\flow.cpp(27) : 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.Flow.exe - 1 error(s), 0 warning(s)
用MSDN介绍的方法也解决不了,网上介绍的rebuild all 以及禁用预编译头文件也不行,请问各位请是怎么回事?我用的是Win98+VC6.0创天中文版,救救我啊!
#include <iostream.h>
#include <string.h>class CDemo
{
public:
CDemo(const char* str);
~CDemo();
private:
char name[20];
};CDemo::CDemo(const char* str)
{
strncpy(name, str, 20);
cout << "Constructor called for " << name << '\n';
}CDemo::~CDemo()
{
cout << "Destructor called for " << name << '\n';
}void func()
{
CDemo LocalObjectInFunc("LocalObjectInFunc"); // in stack
static CDemo StaticObject("StaticObject"); // local static
CDemo* pHeapObjectInFunc = new CDemo("HeapObjectInFunc"); // in heap cout << "Inside func" << endl;}CDemo GlobalObject("GlobalObject"); // global staticvoid main()
{
CDemo LocalObjectInMain("LocalObjectInMain"); // in stack
CDemo* pHeapObjectInMain = new CDemo("HeapObjectInMain"); // in heap cout << "In main, before calling func\n";
func();
cout << "In main, after calling func\n";}
出错提示是:
Compiling...
Flow.cpp
e:\深入浅出 mfc\dissect\flow.02\flow.cpp(27) : 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.Flow.exe - 1 error(s), 0 warning(s)
用MSDN介绍的方法也解决不了,网上介绍的rebuild all 以及禁用预编译头文件也不行,请问各位请是怎么回事?我用的是Win98+VC6.0创天中文版,救救我啊!
解决方案 »
- SOCKET API收到的RAR文件显示未可预料的压缩文件未端
- STREAM_TIME是怎样的?为什么我在msdn中找不到它实现的.怎样将它转换成CTime类型?
- CListView中列表的属性怎样获取?
- DLL的问题~!我想在其它人机子上不用DLL就可以远行。怎样加载到EXE里啊?
- 请问有没有 vc操作xml4的例子啊,很急的,请帮帮我啊
- 通过PCI配置空间,得出了device id和vendor id,如何测出是哪个厂商的?
- 这么晚了 还来问个问题 别人的属性页都是三个按钮 (确定 取消 应用) 可是我的确多了一个帮助 怎么才能去掉它?
- ADO,不太高深但很有用的問題把我難住了,請求幫忙!!!!
- 100分询问如何解autocad vba的密码!
- 如何在ATL建的exe中加入对mfc的支持,比如CString?
- 对话框类消失~??
- 大家对现在的房市有什么看法???
就报告个这样的东东内部编译错误?水平较菜,我觉得程序没怎么问题,顶多应该还要delete下 NEW的东东