1.使用预处理指令,增加链接器选项
#pragma comment(linker, "/EXPORT:MyFunction=_MyFunction@4")
/EXPORT 选项格式如下:
/EXPORT:entryname[,@ordinal[,NONAME]][,DATA]
2.使用__declspec(dllexport)
__declspec(dllexport) void __stdcall MyFunction(int n);
3.使用Def文件
LIBRARY LIST
EXPORTS
MyFunction @1
