linux va_start 编译,如何把unix 下的c程序移植到suse linux下,编译出错?

FILE *gfp_out = stdout;---------------------第45行:报:err.c:45: error: initializer element is not constant

#include 。。。 。。。

int err_set_info( char * ps_error_type,

int i_error_no,

int i_severity,

char * ps_file,

long l_line,

char * ps_dtl_msg_fmt,

...

)

{

va_list ap;

char s_detail_msg[ MX_ERR_DTL_MSG_LEN + 1 ];

/*va_start( ap,(void) ps_dtl_msg_fmt );*/

va_start( ap, ps_dtl_msg_fmt );

vsprintf( s_detail_msg, ps_dtl_msg_fmt, ap );

va_end( ap );

。。。 。。。

switch( l_err_type ) {

case ETYPE_CD_OPSYS:

err_opsys_msg ( r_err_info_struct.i_error_no,

r_err_info_struct.s_standard_msg );

break;

case ETYPE_CD_ORACLE:

err_sql_msg ( r_err_info_struct.s_standard_msg );

break;

default:

i_ret_cd = get_std_msg( l_err_type ,------------------第314行,报:err.c:314: error: previous implicit declaration of ??et_std_msg??was here

r_err_info_struct.i_error_no ,

r_err_info_struct.s_standard_msg );

break;

} /* end switch */

。。。 。。。

static int get_std_msg( long l_err_type ,

long l_err_no ,

char * ps_std_msg )

{--------------------第685行:报:err.c:685: error: static declaration of ??et_std_msg??follows non-static declaration,且有乱码??

。。。 。。。

}

现在编译后,报错信息:

[Linux:/home/eam/src/arch]make -f arch.mk

/usr/bin/cc -c -g -I. -DARCH_DEBUG -I/home/eam/include/arch -I/home/eam/include/arch -o /home/eam/lib/err.o err.c

err.c:45: error: initializer element is not constant

err.c:685: error: static declaration of ??et_std_msg??follows non-static declaration

err.c:314: error: previous implicit declaration of ??et_std_msg??was here

err.c:749: error: static declaration of ??et_hdl_sug??follows non-static declaration

err.c:606: error: previous implicit declaration of ??et_hdl_sug??was here

err.c:823: error: static declaration of ??oad_std_msg_file??follows non-static declaration

err.c:703: error: previous implicit declaration of ??oad_std_msg_file??was here

err.c:972: error: static declaration of ??oad_hdl_sug_file??follows non-static declaration

err.c:767: error: previous implicit declaration of ??oad_hdl_sug_file??was here

make: *** [/home/eam/lib/err.o] Error 1

[Linux:/home/eam/src/arch]

麻烦大虾帮忙解决,非常感谢!

主要问题是,

1、error: initializer element is not constant

2、定义的静态函数报错

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值