vs dll 示例

//dllsample.h

extern "C" _declspec(dllexport) int add(int a, int b);


//dllsample.cpp

#include "dllSample.h"
int Entry()
{
return 1;
}
int add(int a,int b)
{
    return a + b;
}

 

//comile.bat

@call "E:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"

@cl dllSample.cpp /link /out:dllSample.dll /dll /Entry:Entry /OPT:NOWIN98 /machine:x86

echo =============================

echo 创建dll完成

echo =============================

del dllSample.exp dllSample.obj

pause

posted @ 2010-09-17 23:37  网络小虫  阅读(242)  评论(0编辑  收藏  举报