Nauty编译失败 gtools.c:237:1: error: conflicting types for ‘getline’

报错信息


gtools.c:237:1: error: conflicting types for ‘getline’
getline(FILE f) / read a line with error checking */
^
In file included from nauty.h:43:0,
from naututil.h:99,
from gtools.h:30,
from gtools.c:7:
/usr/include/stdio.h:678:20: note: previous declaration of ‘getline’ was here

原因


主要是gcc编译库stdio.h中含有 getline方法,导致重名,

nauty的gtools中先导入了stdio然后自定义了getline方法,故报错

解决


官方解决办法

answer:

In Ubuntu, we've applied the attached patch to achieve the following:

  • Fix FTBFS: gtools.c getline renamed to gtools_getline. (LP: #521190)

We thought you might be interested in doing the same.


即将 getline重命名为gtools_getline,
注意调用重命名方法

end

posted on 2019-04-12 01:08  script<0>  阅读(272)  评论(0)    收藏  举报

导航