pic11
pic11

Reputation: 14943

cppcheck can't find include files

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

I am using Ubuntu 11.04 and cppcheck from the repository.

Upvotes: 44

Views: 53036

Answers (2)

user405725
user405725

Reputation:

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.

Upvotes: 29

mcandre
mcandre

Reputation: 24602

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 .

Upvotes: 50

Related Questions