On 11 February 2011 18:30, Remi Collet wrote:
>
> Hi,
>
> During fedora 15 mass rebuild, mysql++ fails to build because of some
> changes in new GCC 4.6.
>
> In file included from ./lib/sql_buffer.h:31:0,
> from
> ./lib/sql_buffer.cpp:26:
> ./lib/refcounted.h:258:2: error: 'size_t' does not name a type
>
>
> From GCC documentation:
>
> STL headers not including <cstddef> any longer
>
> 2 solutions :
> - include <cstddef>
> - use std::size_t
std::size_t is defined by <cstddef>, so the correct fix if you want to
use size_t is to explicitly include either <stddef.h> (for ::size_t)
or <cstddef> (for std::size_t)
Otherwise some other change to the Standard Library could cause the
same problem again. If you use a type, include the header that
declares it.