whiteperl has asked for the wisdom of the Perl Monks concerning the following question:

I'm getting into game programing. (C++) Sooner or later I will need to Embed a scripting language in my program. Since I am familar with perl I have decided to use it. The problem is the examples of how to embed it in a C program are for *nix based compilers and I use windows. Has anyone ever done this using ActiveState perl? I use Borland C++ builder 4.5 and Dev C++. thanks

Replies are listed 'Best First'.
Re: Embed perl in C/C++
by Zaxo (Archbishop) on May 31, 2003 at 20:23 UTC

    See perlembed. You may have difficulty with your compiler butting heads with the compiler used to build perl.

    After Compline,
    Zaxo

      Thanks I tried that link before and followed the instructions. The problems start at #include <perl.h>, apparently Borland dosent like that header file. This was about a week ago so I cant rember the exact errors and warnings. What I do know is that I added the libs and header files I was supposed to. Thats why I asked specifically about windows, the example seems to be *nix biased. I wanted someone who actually did it before. Preferably with a non M$ compiler. Thanks again.

        The perl.h header file is part of the perl installation, it wouldn't be in the Borland distro. You need to add the location of the perl headers to the #include search path. On mine, that is in the perl library location at {version}/{platform}/CORE .

        After Compline,
        Zaxo

Re: Embed perl in C/C++
by DigitalKitty (Parson) on May 31, 2003 at 20:52 UTC
    Hi whiteperl.

    Embedding provides a great deal of power, speed, etc. In order to help facilitate your objective, I thought the following book might be of use:

    • Title:Extending and Embedding Perl
    • List Price:$44.95
    • ISBN:1930110820
    • Publisher:Manning Press

    You can peruse the table of contents and code at:
    http://www.manning.com/jenness/index.html

    Hope this helps,
    -Katie.
      Thanks If all else fails I will buy a book on the topic. At this stage i'll keep trying though.