in reply to Using the perl API in C

Well, if you want to test only your C code without testing the glue between your code and perl, then just separate the library and the glue.

If the question was really about the link-time flags, then other comments provide good answers.