关于xxx.lib 引入调用的问题
头文件.h
#ifndef _ILBC_H
#define _ILBC_H
#include <mmsystem.h>
//宏定义,如果系统没有声明WINAPI,则进行声明,_stdcall为标准调用方式
#ifndef WINAPI
#define WINAPI _stdcall
#endif
//////////////////////////////////////////
#ifdef __iLBC_DLL_IMPORT
#include "iLBC_encode.h"
#include "iLBC_decode.h"
iLBC_Enc_Inst_t iLBCenc_inst;
iLBC_Dec_Inst_t iLBCdec_inst;
#define iLBC_API(type, name , args) \
extern "C" type __declspec(dllexport) WINAPI name args;
#else
#define iLBC_API(type, name , args) \
extern "C" type __declspec(dllimport) WINAPI name args;
#endif
///////////////////////////////////////////////////////////////////
iLBC_API(bool, ilbc_init, ());
iLBC_API(int, ilbc_encoder, (short *pin,unsigned char *pout));
iLBC_API(int, ilbc_decoder, (unsigned char *pin,short *pout));
#endif
cpp文件关键代码
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
....//代码
return TRUE;
}
bool WINAPI ilbc_init()
{
........
}
int WINAPI ilbc_encoder(short *pin,unsigned char* pout)
int WINAPI ilbc_decoder(unsigned char *pin ,short *pout)
生成一个lib和一个dll
我自己新建了另外一个dll项目 想引入这个lib 引入后。应该怎么调用?
我是c++ 小白 找了多资料还是不懂。各位大神们。求解答!
或者给我一个可以直接调用的iLBC.lib也行 告诉我怎么用!
最后30分了。求解!