error: ‘ptrdiff_t’ does not name a type

When I was compiling htmlcxx under Ubuntu 11.10, a compile error occurs. It shows

In file included from ParserDom.h:5:0,
tree.h:118:21: error: 'ptrdiff_t' does not name a type

The error is occurred because Ubuntu 11.10 is using GCC 4.6.3.
Here is the common issues with GCC4.6/G++4.6:

To fix the error in tree.h:118:21 for ptrdiff_t, just add “#include <cstddef>” to the header.

Published by


You never know me... Need-Being... Human Being? or Just Being Here...

2 thoughts on “error: ‘ptrdiff_t’ does not name a type”

Leave a Reply

Your email address will not be published. Required fields are marked *