This was created for testing my patch for C++ perl modules. It runs with dynamic and static extensions under OS/2. It should work with gcc and dynamic build out of the box. With other compilers you should find a different mean to convince MakeMaker to compile the file as C++. With gcc I just put '-x c++' into INC (yuck ;-) of Makefile.PL. Try to peruse different buttons of MakeMaker. The patch is in the file `patch'. After the patch is applied you can compile perlmain.c with C++ compiler and use it with static and dynamic C++ modules. You may force a particular way of perl compile in build directory by editing the corresponding line in `cflags', similar to this (for gcc): perlmain) cc="$cc -x c++";; It is possible to build static C++ extensions, probably something like what is below (CC=CC on 'make' line) should work. With gcc you do it like this: make static make perlmain.o CC="gcc -x c++" make perl (if on OS/2, substitute `make perlmain.obj'). Dynamic build of example C++ extension: Apply patch, remake perl, install it (or copy h2xs, xsubpp and all other relevant files (like Miniperl.pm) to appropriate locations). Do this in perl build directory: patch < ...../patch sh writemain.SH make make test make install Keep in mind that perlmain.c is autogenerated by writemain that is autogenerated by writemain.SH, but the last rule is not in makefiles. Similarly with Miniperl.pm and minimod.PL, but this time the rule is there. The above sequence most probably does all the black magic ;-0. Then run perl Makefile.PL make make test If you do not have gcc, probably you should run something like make CC=CC INC=