my.cpp(1): fatal error C1083: 无法打开包括文件:“stdafx.h”: No s

C语言 码拜 7年前 (2017-04-30) 973次浏览
在MyCode.h中输入以下代码:
复制代码 代码如下:
#ifndef _MYCODE_H_
#define _MYCODE_H_
#ifdef DLLDEMO1_EXPORTS
#define EXPORTS_DEMO _declspec( dllexport )
#else
#define EXPORTS_DEMO _declspec(dllimport)
#endif
extern “C” EXPORTS_DEMO int Add (int a , int b);
#endif
在MyCode.cpp中输入以下代码:
复制代码 代码如下:
#include “stdafx.h”
#include “MyCode.h”
int Add ( int a , int b )
{
return ( a + b );
}
编译工程,出现错误代码,求高手指点解决方法
解决方案

10

//#include “stdafx.h”

10

引用:
Quote: 引用:

//#include “stdafx.h”

为什么要注释掉呢,本人看网上大部分的源码都带这个,新手不懂

百度搜stdafx.h


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明my.cpp(1): fatal error C1083: 无法打开包括文件:“stdafx.h”: No s
喜欢 (0)
[1034331897@qq.com]
分享 (0)