错误:error: no matches converting function ‘ItemComareFunc’ to type ‘__compar_d_fn_t’ {aka ‘int (*)(const void*, const void*, void*)’}

qsort_r函数参数传递错误

转到模板函数 __compar_d_fn_t
模板函数的参数 为 (const void *,const void * void *) ,而实际传入的是(void *,const void * ,const void *) 导致无法匹配

修改UIList.h的ItemComareFunc函数的参数位置与模板函数一致 <

在Linux上编译DuiLib库时遇到error: no matches converting function ‘ItemComareFunc’ to type ‘__compar_d_fn_t’的问题。错误源于qsort_r函数参数传递不匹配,ItemComareFunc的参数与模板函数__compar_d_fn_t不一致。解决方案是调整UIList.h和UIList.cpp中ItemComareFunc函数的参数顺序,使其与模板函数匹配。经过修改和重新编译,成功生成libDuiLib.so库。
订阅专栏 解锁全文
2942

被折叠的 条评论
为什么被折叠?



