转载:https://blog.csdn.net/gaofeidongdong/article/details/7781345 在工程属性中 预编译宏中加上 DLL_EXPORT为了减少使用dll时候的设置或者代码编写,把dll.h修改一下:#ifndef DLL_EXPORT#define DECLDIR __declspec(dllimport)#else#define DECLDIR __declspec(dllexport)#endifdll实现代码:#include "stdafx.h…