Can I embed Strawberry Perl in a VC++ 6.0 compiled application or use Inline::C with the compiler mismatch?

StackOverflow https://stackoverflow.com/questions/375015

Question

I am looking at embedding perl 5.10 in a large C++ application compiled with VC++ 6.0. This leads to two questions.

1) Is it a bad idea to simply use Strawberry Perl as a dependency rather than compile my own perl with VC++ 6.0? Would Strawberry even work given the compiler mismatch? I presume Strawberry is compiled with mingw. I would much rather not have to keep my own custom perl build around.

2) If I went the Strawberry route, would something like Inline::C work in the embedded application? You'd have VC++ 6.0 code calling mingw compiled Strawberry in turn calling user mingw compiled code. Inline::C would be an awesome capability for what I'm trying to achieve with the embedded perl interpreter.

Was it helpful?

Solution

Given the uncertainty involved, I would recommend compiling Perl using MSVC instead of experimenting with Strawberry Perl for this application. There are instructions in perlwin32 and a related discussion on Perl Monks to guide you.

As a former release manager for Strawberry Perl, I can tell you it's not terribly difficult to do if you're comfortable with a compiler already.

-- xdg

OTHER TIPS

Activestate perl is compiled with VC++ 6.0. It can use VC++ 6.0 or MinGW to compile modules since they link to the same C runtime library, msvcrt.dll. It would be preferable to use MinGW because VC++ 6.0 is neither free nor readily available (unless you can be sure that it is installed on the target machine.) You can PPM install Mingw now, and compile modules from CPAN. A large number of modules compile without trouble. You may have to configure CPAN with:

o conf yaml_module '' (Two single quotes, nothing between)

o conf commit

Inline::C works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top