in reply to RE: Re: using XS with C++
in thread using XS with C++

I'm pretty sure that the XSOPT=>'-C++' option is only partially implemented. It only does (at most) one of something like 3 things that it should do.

Now, I think the direction C and C++ compilers have moved is that you use "cc" to compile both C and C++ files and the compiler determines what type of code it is compiling by whether the file name ends in .c or one of .cc, .cpp, .c++, .cxx, etc., where each compiler recognizes about two different extensions for C++ code. So the CC=cc is probably not a problem. The problem is that it is generating a file named myclass.c instead of myclass.cxx.

I managed to use C++ in XS as part of some other strange work I was doing (see the latest versions of Win32API::File, for example). I used .cxx and wrote my own rules out with sub MY::postamble. At least the latest MakeMaker knows how to compile a .cxx file if you ask it to.