my.cpp(1): fatal error C1083: 无法打开包括文件:“stdafx.h”: No such file or directory
在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 );
}
编译工程,出现错误代码,求大神指点解决方法