CentOS和redhat [英] CentOS and redhat

查看:67
本文介绍了CentOS和redhat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个代码。我可以用redhat编译得很好。但当我转向

CentOS

我遇到了问题。

MAPlib.c:16:错误:参数1的不兼容类型`记录''


我的日志定义为

void log(FILE * fp,const char * fmt,...)

{

如果(!debugFlag)返回;

va_list argp;

va_start(argp,fmt);

vfprintf(fp,fmt,argp);

va_end(argp);

}


什么是问题?


I have a code. I can compile well in redhat. but when I swich to
CentOS
I ran into problems.
MAPlib.c:16: error: incompatible type for argument 1 of `log''

while my log is defined as
void log(FILE *fp,const char *fmt, ...)
{
if(!debugFlag) return;
va_list argp;
va_start(argp, fmt);
vfprintf(fp, fmt, argp);
va_end(argp);
}

What''s the problem?

推荐答案

qi ** ***@gmail.com 写道:
qi*****@gmail.com writes:

我遇到了问题。

MAPlib.c:16:错误: log的参数1的不兼容类型
I ran into problems.
MAPlib.c:16: error: incompatible type for argument 1 of `log''



" log"是标准C库中的函数。它计算并且

返回其浮点参数的自然对数。

"log" is a function in the standard C library. It computes and
returns the natural logarithm of its floating-point argument.


而我的日志定义为

void log(FILE * fp,const char * fmt,...)

{

if(!debugFlag)return;

va_list argp;
while my log is defined as
void log(FILE *fp,const char *fmt, ...)
{
if(!debugFlag) return;
va_list argp;



只有在C99中,声明才能跟随一个块内的语句。

Only in C99 may declarations follow statements within a block.


va_start(argp,fmt);

vfprintf(fp,fmt,argp);

va_end(argp);

}
va_start(argp, fmt);
vfprintf(fp, fmt, argp);
va_end(argp);
}



试图定义你自己的外部可见函数名为

" log"调用未定义的行为。我建议你重命名你的

功能。

-

Ben Pfaff
http://benpfaff.org


qi ***** @ gmail.com 写道:

我有一个代码。我可以用redhat编译得很好。但当我转向

CentOS

我遇到了问题。

MAPlib.c:16:错误:参数1的不兼容类型`记录''


我的日志定义为

void log(FILE * fp,const char * fmt,...)

{

如果(!debugFlag)返回;

va_list argp;

va_start(argp,fmt);

vfprintf(fp,fmt,argp);

va_end(argp);

}
I have a code. I can compile well in redhat. but when I swich to
CentOS
I ran into problems.
MAPlib.c:16: error: incompatible type for argument 1 of `log''

while my log is defined as
void log(FILE *fp,const char *fmt, ...)
{
if(!debugFlag) return;
va_list argp;
va_start(argp, fmt);
vfprintf(fp, fmt, argp);
va_end(argp);
}



可能是主题偏离主题,但可能是log()不在

范围内,或者你传递的不是文件。由于你没有显示相关代码,所以很难说清楚。


你能否将问题减少到最小的可重现性(即

可编辑)案例?

-

clvrmnky< mailto:sp ****** @ clevermonkey.org>


直接回复将被列入黑名单。替换spamtrap以我的名字给

直接与我联系。

Probably off-topic given the subject, but it may be that log() is not in
scope, or you are passing it something other than a FILE. Since you
show no relevant code, it''s hard to tell.

Can you reduce the problem to the smallest reproduceable (i.e.,
compilable) case?
--
clvrmnky <mailto:sp******@clevermonkey.org>

Direct replies will be blacklisted. Replace "spamtrap" with my name to
contact me directly.


文章< 11 ************** *******@c77g2000hse.googlegroups。 com>,

< qi ***** @ gmail.comwrote:
In article <11*********************@c77g2000hse.googlegroups. com>,
<qi*****@gmail.comwrote:

> MAPlib.c:16:错误: `log''参数1的不兼容类型
>MAPlib.c:16: error: incompatible type for argument 1 of `log''



有一个标准的C函数叫做log,用于对数。

不幸的是,这意味着你必须给你的功能打电话

else。


- Richard

-

应考虑在一些字母表中需要多达32个字符

- 1963年的X3.4。

There''s a standard C function called log, for logarithms.
Unfortunately that means you have to call your function something
else.

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.


这篇关于CentOS和redhat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆