带头文件见得动态链接库的问题(代码以清晰的列出)
/****************MyLib.h**************************************/
//Indicate thar all function/varibles are being import
#define MYLIBAPI extern "C" _declspec(dllimport)
#endif
///////////////////////////
//Define exported varibles here.(NOTE:Avoid exporting varibles)
MYLIBAPI int g_nResult;
//Define exported function prototypes here
MYLIBAPI int Add(int nLeft,int nRight);
/************************MyLib.cpp*************************/
//include the standard windows and c-runtime header file here
#include <windows.h>
//This DLL source code file exports functions and variables
#define MULIBAPI extern "C" _declspec(dllexport)
#include "MyLib.h"
//Place the code for this DLL source code file here
int g_nResult;
int Add(int nLeft,int nRight)
{
g_nResult=nLeft+nRight;
return (g_nResult);
}