in reply to strawberry perl + Inline::CPP + <sstream> compilation error

Maybe somebody already solved similar problems?

Or maybe not ?
The failing script can be reduced to:
use strict; use warnings; use Inline CPP => <<'CPP'; #include <sstream> CPP 1;
which (I think) still produces the same errors.

This would suggest that there's some fundamental incompatibility between perl.h and the sstream header with mingw-w64 compilers.
But it's not clear to me just what that incompatibility is. (We might need someone with some C++ insights to chime in.)

Do you really need to include sstream ?

UPDATE: For those interested, the original post has been cross-posted to stackoverflow.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: strawberry perl + Inline::CPP + <sstream> compilation error
by zdm (Beadle) on Jun 04, 2018 at 02:15 UTC
    <sstream> is used by dlib (dlib.net). I am using dlib in my project.
      <sstream> is used by dlib (dlib.net). I am using dlib in my project

      I guess that means you'll need sstream ;-)

      There's a reply on stackoverflow that indicates that the problem is that one of the standard perl headers defines "setbuf".
      I find that the following compiles ok for me:
      use strict; use warnings; use Inline CPP => <<'CPP'; #undef seekdir #ifdef _WIN32 #undef setbuf #endif #include <sstream> CPP 1;
      So see how that works for you.

      Cheers,
      Rob
        The problem is solved. <code> #undef setbuf #undef wait </cpan> Thank you very much!