Reputation: 976
I have two VS10 projects, one is a (not MFC) DLL. I want to use in the DLL project a struct
defined in one header file of the other project. The projects use the precompiled headers and all the includes are made under stdafx.h
.
Project One
struct example
{
int a;
int b;
};
DLL Project
#include "stdafx.h"
extern "C"
{
__declspec(dllexport) int ex(struct example *p)
{
int c = p->a;
return 1;
}
}
struct example
must be visible from the DLL project. How can I achieve that?
Upvotes: 0
Views: 142
Reputation: 149
This can be solved at compile time by putting the Struct in a separate header file and including it in both projects.
Upvotes: 1