For MySQL, make sure you have the dev libs installed, and make note of where the header files are placed.
For the "int x=0", you can create the variable before the FOR loop, and then in the loop use "x=0". Apparently, the version of gcc in CentOS is configured to NOT use C99 by default...
When posting errors, just post the modules that throw errors instead of the entire output. Easier for me or anyone else to help.