in reply to problem with libperl.so

There is no Perl with version 97r1.3.

The general rule for binary compatibility between Perl versions is, that binary compatibility is supposed to be maintained between the Perl5 minor releases. So in theory, all versions of Perl 5.8.x are binary compatible among each other, as are all versions of Perl 5.6.x. In practice, this also depends on whether your Perl is built with threading enabled and if it's built with 64-bit support enabled, and some other compile-time options.

My rule of thumb is to use one C compiler for both, Perl and its extensions, and that would extend in your case to using one C compiler for all, Perl, your C program, and all Perl extensions. This means that you will have to either recompile Perl with gcc 2.81 (I don't know if that ancient gcc works well, as the only "old" gcc I know/use is 2.95), or have to recompile your C program with gcc 3.3.3.

If you go the easier route of compiling your own private Perl with gcc 2.8.1, you should find ample debugging output when you run ./Configure to configure the version of Perl. Having "a big wall" is not an error message I recognize, so maybe you could post the (full) output of the Configure run instead.