标签:
-Werror,编译出现如下错误:
src/wtk/exam/wtk_ndx.c:154:6: error: passing argument 3 of ‘wtk_hlv_rec_init’ discards ‘const’ qualifier from pointer target type [-Werror]
ret = wtk_hlv_rec_init(&(nd->rec_hd), &(cfg->rec_hd), nd->hmmset, 0.02f);
^
In file included from src/wtk/exam/wtk_ndx.h:13:0,
from src/wtk/exam/wtk_ndx.c:13:
函数申明: int wtk_hlv_rec_init(wtk_hlv_rec_t* r, const wtk_hlv_rec_cfg_t* cfg, wtk_hmmset_t *hs, double frame_dur);
nd->hmmset为常量
解决办法:1)修改函数申明 int wtk_hlv_rec_init(wtk_hlv_rec_t* r, const wtk_hlv_rec_cfg_t* cfg, const wtk_hmmset_t *hs, double frame_dur);
2)使用时强制转换 wtk_hlv_rec_init(&(nd->rec_hd), &(cfg->rec_hd), (wtk_hmm_t *)nd->hmmset, 0.02f);
passing argument 3 of ‘wtk_hlv_rec_init’ discards ‘const’ qualifier from pointer target type
标签:
原文地址:http://www.cnblogs.com/tibetanmastiff/p/5408597.html