cppcheck can't find include files

做~自己de王妃 提交于 2020-12-29 02:42:24

问题


cppcheck can't find even standard headers such as iostream. Any ideas?

I am using Ubuntu 11.04 and cppcheck from the repository.


回答1:


cppcheck is really bad at finding standard include headers, on Mac and Linux. Fortunately, you can suppress this check, and only scan your custom header files:

cppcheck --enable=all --suppress=missingIncludeSystem .



回答2:


It isn’t recommended to provide the paths to the standard C/C++ headers - Cppcheck has internal knowledge about ANSI C/C++ and it isn’t recommended that this known functionality is redefined. But feel free to try it.

-I [dir]

Give include path. Give several -I parameters to give several paths. First given path is checked first. If paths are relative to source files, this is not needed.



来源:https://stackoverflow.com/questions/6986033/cppcheck-cant-find-include-files

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