VC創(chuàng)建DLL動態(tài)鏈接庫的方法
更新時間:2015年05月21日 15:18:50 作者:好人一個
這篇文章主要介紹了VC創(chuàng)建DLL動態(tài)鏈接庫的方法,實例分析VC創(chuàng)建動態(tài)鏈接庫的完整步驟,需要的朋友可以參考下
本文實例講述了VC創(chuàng)建DLL動態(tài)鏈接庫的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:
頭文件中聲明 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文件中寫函數(shù)體
#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程序設(shè)計有所幫助。
相關(guān)文章
OpenCV實現(xiàn)簡單攝像頭視頻監(jiān)控程序
這篇文章主要為大家詳細介紹了OpenCV實現(xiàn)簡單攝像頭視頻監(jiān)控程序,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-08-08舉例剖析C++中引用的本質(zhì)及引用作函數(shù)參數(shù)的使用
這篇文章主要介紹了C++中引用的本質(zhì)及引用作函數(shù)參數(shù)的使用,講解了函數(shù)返回值是引用的情況等一些難點,需要的朋友可以參考下2016-03-03