Martin Michlmayr
Martin Michlmayr

I'm a member of Debian, and I work for HP as an Open Source Community Expert. The opinions expressed here are mine.

Subscribe to the RSS feed of this journal.

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 definesHeader
fopen, fwrite, fclosecstdio
fread, fseek, feofcstdio
sscanf, sprintfcstdio
rename, opencstdio
EOFcstdio
memset, memcpy, strdupcstring
va_listcstdarg
int16_t, uint32_tstdint.h
Mon, 10 Nov 2008; 19:21 — gccpermanent link