Dec 11, 2009

'snprintf' was not declared in this scope

This is one of the incompatibility problem of Linux.

I have found this problem while installing MySQLConnector/C++.

The source code is written in some Linux distribution in which snprintf() is in stdlib.h.

But, in my Linux distribution, Fedora Core 12, snprintf() is in cstdio.

Therefore, the way to fix it is to add #include <cstdio>.

PS. The problem can also be something like 'printf' was not declared in this scope.