in reply to compiling problems of calling perl from C

Seems like you should drop -pedantic-errors and replace it with -pedantic. The ISO Cxx warnings are treated like errors, but should really be only (yea) warnings.

Probably you already knew this...