createLib.h文件
#ifdef DLL_EXPORTS
#define MYDLL_EXPORT __declspec(dllexport)
#else
#define MYDLL_EXPORT __declspec(dllimport)
#endif
MYDLL_EXPORT int sum (const int x,const int y);
MYDLL_EXPORT int sub (const int x,const int y);
createLib.c文件
#define DLL_EXPORTS
#include "creatLib.h"
int sum(const int x, const int y)
{
return x + y;
}
int sub(const int x, const int y)
{
return x - y;
}