g++ 4.7.1 compilation error : conflicting types for ‘strsignal’

試著忘記壹切 提交于 2019-11-29 03:56:42

I had the same problem. In my case, I solved it by unsetting the bash variables CPATH, LIBRARY_PATH and C_INCLUDE_PATH. After that, the build went fine.

I used

unset LIBRARY_PATH CPATH C_INCLUDE_PATH PKG_CONFIG_PATH CPLUS_INCLUDE_PATH INCLUDE

Since I don't have root access on this machine, and so I have appended to a lot of those variables.

Other solutions did not work for me, because I use those env variables to point gcc to some of its dependencies. Also unsetting variit does not sound like a very precise fix :)

Turns out the problem is I had some trailing : in my env vars declarations, like so:

$ export LIBRARY_PATH=/foo/bar:$LIBRARY_PATH
$ echo $LIBRARY_PATH
/foo/bar:

The result is that LIBRARY_PATH will always include the current directory too. Setting the env variables properly, with no trailing :, solved the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!