vs2012编译C++程序报错C2660:“readparmfile”:函数不接受1个参数
#pragma commment(lib,"VedioMpeg2Enc.lib")
int _tmain(int argc,_TCHAR *argv[])
{
if (argc!=3)
{
printf(" %s, %s ",version,author);
printf("Usage: mpeg2encode in.par out.m2v ");
exit(0);
}
/* read parameter file */
readparmfile(argv[1]);////////////////////////////////////报错处
/* read quantization matrices */
readquantmat();
/* open output file */
if (!(outfile=fopen(argv[2],"wb")))
{
sprintf(errortext,"Couldn't create output file %s",argv[2]);
error(errortext);
}
init();
putseq();
fclose(outfile);
fclose(statfile);
return 0;
}
另一工程下创建静态库,函数定义如下:
static void readparmfile(char *fname)
{
int i;
int h,m,s,f;
FILE *fd;
char line[256];
static double ratetab[8]=
{24000.0/1001.0,24.0,25.0,30000.0/1001.0,30.0,50.0,60000.0/1001.0,60.0};
extern int r,Xi,Xb,Xp,d0i,d0p,d0b; /* rate control */
extern double avg_act; /* rate control */
if (!(fd = fopen(fname,"r")))
{
sprintf(errortext,"Couldn't open parameter file %s",fname);
error(errortext);
}
这个问题多数是因为在头文件中的函数声明与.cpp文件中的函数定义不一样,比如,我在某cpp文件中定义void addList(USERINFO a)函数,而.h头文件中声明却为extern void addList(),于是在main函数中调用addList(userinfo)时就会有这个错误,修改:把.h头文件中声明改为:extern void addList(USERINFO a)就可以了...
这个要看在程序中readparmfile函数的声明的