The problem is cppcheck recognize content of the .h files as C language. You can force it to handle them as C++. Just pass the --language=c++ argument.