GCC 4.4 related build problems: missing #include
C++ header dependencies got cleaned up in GCC 4.3, which broke a lot of code which relied on headers to be included indirectly through some other headers. I found some new build failures with GCC 4.4 related to missing #includes; in particular, #include <cstdio> is missing in a lot of code.
Typical errors look like these:
error: 'sscanf' was not declared in this scope error: 'EOF' was not declared in this scope error: '::fseek' has not been declared error: 'uint32_t' does not name a type
Below is a table showing which header needs to be included for a number of common functions:
Functions and defines | Header |
fopen, fwrite, fclose | cstdio |
fread, fseek, feof | cstdio |
sscanf, sprintf | cstdio |
rename, open | cstdio |
EOF | cstdio |
memset, memcpy, strdup | cstring |
va_list | cstdarg |
int16_t, uint32_t | stdint.h |