我有两个 VS10 项目,一个是(不是 MFC)DLL。我想在 DLL 项目中使用在struct
另一个项目的一个头文件中定义的。这些项目使用预编译的头文件,所有的包含都在stdafx.h
.
项目一
struct example
{
int a;
int b;
};
DLL 项目
#include "stdafx.h"
extern "C"
{
__declspec(dllexport) int ex(struct example *p)
{
int c = p->a;
return 1;
}
}
struct example
必须在 DLL 项目中可见。我怎样才能做到这一点?