How can I embed Perl Interpreter inside a C++ application making DLL?

孤者浪人 提交于 2020-01-03 18:35:11

问题


I need a DLL built in C++ having Perl interpreter inside it and a Perl library exiftool by Phil Harvey being called by C++ functions.

I want to do it on Windows 7 with Visual Studio 2010 VC++ installed. Which Perl distribution is best for this task: Strawberry or ActiveState Perl? Also, which Perl compilation command: nmake or dmake?

In the end the final deliverable should be a DLL. This can be imported into any program C etc and the DLL functions will be called which will internally be calling Phil Harvey's exiftool library functions/arguments/switches.


回答1:


If you've got Perl installed, the first thing you should do is look at the manpage for perlembed, i.e. "man perlembed" on Unix systems. Since you are on Windows, you are better off looking at the official Perl documentation on the web for "perlembed".

There's a specific section on Win32 on that information page. As for the specifics and caveats of including perl as a DLL, I'm not much help there.




回答2:


It could be a little overkill, but a SWIG page mentions accessing Perl from NMAKE, and by extension, Visual Studio.



来源:https://stackoverflow.com/questions/8199457/how-can-i-embed-perl-interpreter-inside-a-c-application-making-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!