编程时老是提示warning,不知是什么原因我文件-->新建-->工程-->Win32 Dynamic-Link Library-->创建一个简单的Dll工程。
// 005.cpp : Defines the entry point for the DLL application.
//#include "stdafx.h"BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
 )
{
    return TRUE;
}extern "C" __stdcall int getvalue21()
{ return 16;
}extern "C" __stdcall int getvalue22(int i)
{
i++;
return i;
}
//---------005.DEP--------------------------
;005.def:Declare the module parameters for the dll.
LIBRARY "005"
DESCRIPTION '005 Windows Dynamic Link Library '
EXPORTS
;Explicit exports can to here
getvalue21 @1,
getvalue22  @2
其它文件是系统自动生成的,我没有改
编译结果如下
--------------------Configuration: 005 - Win32 Debug--------------------
Compiling...
005.cpp
D:\XJ_Work_Station\test\1202\005\005.cpp(14) : warning C4518: 'int ' : storage-class or type specifier(s) unexpected here; ignored
D:\XJ_Work_Station\test\1202\005\005.cpp(14) : warning C4230: anachronism used : modifiers/qualifiers interspersed, qualifier ignored
D:\XJ_Work_Station\test\1202\005\005.cpp(20) : warning C4518: 'int ' : storage-class or type specifier(s) unexpected here; ignored
D:\XJ_Work_Station\test\1202\005\005.cpp(20) : warning C4230: anachronism used : modifiers/qualifiers interspersed, qualifier ignored
Linking...005.dll - 0 error(s), 0 warning(s)