VC創立DLL靜態鏈接庫的辦法。本站提示廣大學習愛好者:(VC創立DLL靜態鏈接庫的辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是VC創立DLL靜態鏈接庫的辦法正文
本文實例講述了VC創立DLL靜態鏈接庫的辦法。分享給年夜家供年夜家參考。詳細完成辦法以下:
頭文件中聲明 t.h
#ifdef DLL_API #else #define DLL_API extern "C" _declspec(dllimport) #endif DLL_API int a(int cnt); DLL_API int b(int cnt);
.h文件引入
#define DLL_API extern "C" _declspec(dllexport) #include "t.h"
cpp文件中寫函數體
#define DLL_API extern "C" _declspec(dllexport)
#include "t.h"
int a(int cnt)
{
return cnt+1;
}
int b(int cnt)
{
return cnt+10;
}
願望本文所述對年夜家的VC法式設計有所贊助。