我可以将 Strawberry Perl 嵌入到 VC++ 中吗? 6.0 编译的应用程序或使用 Inline::C 与编译器不匹配?
我正在考虑将 perl 5.10 嵌入到使用 VC++ 6.0 编译的大型 C++ 应用程序中。 这引出了两个问题。
1) 简单地使用 Strawberry Perl 作为依赖项而不是使用 VC++ 6.0 编译我自己的 Perl 是一个坏主意吗? 如果编译器不匹配,草莓还能工作吗? 我猜想 Strawberry 是用 mingw 编译的。 我宁愿不必保留我自己的定制 Perl 构建。
2)如果我走草莓路线,像 Inline::C 这样的东西可以在嵌入式应用程序中工作吗? 您将有 VC++ 6.0 代码调用 mingw 编译的 Strawberry 代码,进而调用用户 mingw 编译的代码。 对于我试图使用嵌入式 Perl 解释器实现的目标来说,Inline::C 将是一个很棒的功能。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
考虑到所涉及的不确定性,我建议使用 MSVC 编译 Perl,而不是针对此应用程序尝试使用 Strawberry Perl。 perlwin32 和 Perl Monks 上的相关讨论为您提供指导。
作为 Strawberry Perl 的前发布经理,我可以告诉您,如果您已经熟悉编译器,那么这并不是很难。
--xdg
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
Activestate perl 使用 VC++ 6.0 编译。 它可以使用 VC++ 6.0 或 MinGW 来编译模块,因为它们链接到相同的 C 运行时库 msvcrt.dll。 最好使用 MinGW,因为 VC++ 6.0 既不是免费的也不是现成的(除非您可以确定它已安装在目标计算机上。) 您现在可以 PPM 安装 Mingw,并从 CPAN 编译模块。 大量模块编译毫无困难。 您可能必须使用以下内容配置 CPAN:
o conf yaml_module '' (两个单引号,中间没有任何内容)
o conf commit
Inline::C 有效。
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.