编译:splint 遇到的问题: undefined reference to `yywrap'

想使用静态代码检查工具: splint,下载了tar包后,编译生成如下问题:


cscanner.o: In function `input':

/home/wine/splint-3.1.2/src/cscanner.c:2483: undefined reference to `yywrap'
cscanner.o: In function `yylex':
/home/wine/splint-3.1.2/src/cscanner.c:2133: undefined reference to `yywrap'
collect2: ld returned 1 exit status
gmake[2]: *** [splint] Error 1
gmake[2]: Leaving directory `/home/wine/splint-3.1.2/src'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/wine/splint-3.1.2'

make: *** [all] Error 2

问过作者:David Evans [[email protected]]了

他这样答复:

The yywrap error is because of not having (or finding)bison/flex installed.

但是,我的系统显然已经安装了flex:

在网上找了个可行的方案,已经验证如下:

解决的办法:在cscanner.c中,直接增加函数:yywrap的定义如下:

int yywrap()

{

return 1;

}

转贴地址:http://www.cppblog.com/ngaut/archive/2006/07/05/9450.html

splint的配置参考:

http://blog.csdn.net/wchinaw/article/details/6331131

splint的官网:

http://www.splint.org/documentation/


你可能感兴趣的:(splint)