ed2kers 资源网搜索:关于动态库的问题

来源:百度文库 编辑:高校问答 时间:2024/04/29 14:57:15
小弟有一问题请教:我在做一个静态库,想要导出一些函数:
static int ViCodeHead(char *pCodeStream),
static int Encode_frame( x264_t *h, hnd_t hout, x264_picture_t *pic )
我在头文件里写上
#ifdef H264ENCDLL_EXPORTS
#define H264ENCDLL_API __declspec(dllexport)
#else
#define H264ENCDLL_API __declspec(dllimport)
#endif

H264ENCDLL_API int ViCodeInit();
H264ENCDLL_API int ViCodeHead(char* pCodeStream);
H264ENCDLL_API int ViCodeAFrame(char* pSrc,char* pCodeStream, int *pic_type, int *pRandom, bool bRCused);
H264ENCDLL_API int ViCodeEnd(void)
报错如下
encdll2.cpp(102) : error C2491: “ViCodeInit” : 不允许 dllimport 函数 的定义
encdll2.cpp(123) : error C2491: “ViCodeHead” : 不允许 dllimport 函数 的定义
encdll2.cpp(207) : error C2491: “ViCodeAFrame” : 不允许 dllimport 函数 的定义
那位大侠指点一下