我做g729a。dll源码如下
#include "StdAfx.h"
#include "G729ACodec.h"
#pragma comment(lib, "G729a.lib")
//G.729A库函数申明
extern "C" void va_g729a_init_encoder();
extern "C" void va_g729a_encoder(short *speech, unsigned char *bitstream);
extern "C" void va_g729a_init_decoder();
extern "C" void va_g729a_decoder(unsigned char *bitstream, short *synth_short, int bfi);
G729ACodec::G729ACodec(unsigned int frame_count){
frameCount=frame_count;
//初始化G729A编解码器
va_g729a_init_encoder();
va_g729a_init_decoder();
}
G729ACodec::~G729ACodec(void)
{
}
//
//编码函数
//
int G729ACodec::Encode(char *ptoencode,int toencodeLen,char* pencoded,int pencodedLen){
//参数检查
if(ptoencode==0||pencodedLen==0){
return _ERROR_DATA_BUFFER;
}
if(toencodeLen%(int)_BASIC_IN_FRAME_LENGTH!=0||toencodeLen/(int)_BASIC_IN_FRAME_LENGTH!=frameCount){
return _ERROR_DATA_LENGTH;
}
if(pencodedLen%(int)_BASIC_OUT_FRAME_LENGTH!=0||pencodedLen/(int)_BASIC_OUT_FRAME_LENGTH!=frameCount){
return _ERROR_DATA_LENGTH;
}
//开始编码
for(unsigned int i=0;i<frameCount;i++){
va_g729a_encoder((short *)(ptoencode+i*_BASIC_IN_FRAME_LENGTH),(unsigned char *)(pencoded+i*_BASIC_OUT_FRAME_LENGTH));
}
return 0;
}
//
//解码函数
//
int G729ACodec::Decode(char *ptodecode,int todecodeLen,char* pdecoded,int pdecodedLen){
//参数检查
if(ptodecode==0||pdecoded==0){
return _ERROR_DATA_BUFFER;
}
if(todecodeLen%(int)_BASIC_OUT_FRAME_LENGTH!=0||todecodeLen/(int)_BASIC_OUT_FRAME_LENGTH!=frameCount){
return _ERROR_DATA_LENGTH;
}
if(pdecodedLen%(int)_BASIC_IN_FRAME_LENGTH!=0||pdecodedLen/(int)_BASIC_IN_FRAME_LENGTH!=frameCount){
return _ERROR_DATA_LENGTH;
}
//开始编码
for(unsigned int i=0;i<frameCount;i++){
va_g729a_decoder((unsigned char *)(ptodecode+i*_BASIC_OUT_FRAME_LENGTH),(short *)(pdecoded+i*_BASIC_IN_FRAME_LENGTH),0);
}
return 0;
}
提示出错,无法解析的外部符号,我在项目-》属性-》链接器-》附加依赖项里面输入G729a.lib,但是还是不行。请问是怎么回事啊,哪位高人指点一下啊
------解决方案--------------------------------------------------------
先看无法解析的外部符号的函数实现是否在G729a.lib中...