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、定义的静态函数报错