problem including perl header files

Discussion in 'Perl Misc' started by shruti.dabhade@gmail.com, May 15, 2006.

  1. Guest

    hiii all

    I'm tryin to call a perl script from a C program in following 2 ways-

    1.By callin system function.
    But there's some problem because the system function is not able to
    executeany command...it just returns -1.

    2.By using the code given in perldoc perlembed(perl documentation for
    embedding perl in C)
    the code looks like this-

    #include <EXTERN.h> /* from the Perl distribution
    */
    #include <perl.h> /* from the Perl distribution
    */

    static PerlInterpreter *my_perl; /*** The Perl interpreter
    ***/

    int main(int argc, char **argv, char **env)
    {
    my_perl = perl_alloc();
    perl_construct(my_perl);
    perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
    perl_run(my_perl);
    perl_destruct(my_perl);
    perl_free(my_perl);
    }

    now wat happens is that it gives error tht it does not recognise perl.h
    and extern.h
    copying them to Turbo C's include folder doesn help cos then it
    compiles these files also n gives 26 errors!!it is also unable to
    locate the header files tht these files use.
    Is there any way for me to specify in Turbo C,two paths to look for wen
    searching for header files.
    in options>directories>include directories i gave a comma n gave path
    for perl header files..but it doesn work!!!

    Pleeeease help...m at the end of my ideas now!
    Thanx in advance.
    shruti
     
    , May 15, 2006
    #1
    1. Advertising

  2. Guest

    wrote:
    > hiii all
    >
    > I'm tryin to call a perl script from a C program in following 2 ways-
    >
    > 1.By callin system function.
    > But there's some problem because the system function is not able to
    > executeany command...it just returns -1.


    1. Are you using Windows? If so, try running "perl" and the path to the
    script as an argument. or if you're not using windows....

    2. Did you try specifying the full path to the script?

    3. Did you make sur e the script is executable?
     
    , May 15, 2006
    #2
    1. Advertising

  3. wrote in news:1147687552.707282.302620
    @y43g2000cwc.googlegroups.com:

    > hiii all


    'Hi'

    > 1.By callin system function.
    > But there's some problem because the system function is not able to
    > executeany command...it just returns -1.


    Are you sure you are specifying the correct path to the executable?

    > now wat happens is that it gives error tht it does not recognise
    > perl.h and extern.h


    Every compiler has a specific way of specifying additional include
    directories on the command line.

    > copying them to Turbo C's include folder doesn help cos then it


    What does this have to do with trigonometry?

    > Is there any way for me to specify in Turbo C,


    Look in the documentation for your compiler.

    On the other hand, TC is a 16-bit compiler, and I would not assume
    things would work smoothly.

    Do you have to use such a dinosaur?

    Sinan
    --
    A. Sinan Unur <>
    (remove .invalid and reverse each component for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, May 15, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Smith

    Header files included in header files

    John Smith, Jul 21, 2004, in forum: C Programming
    Replies:
    18
    Views:
    624
    Jack Klein
    Jul 24, 2004
  2. Replies:
    3
    Views:
    1,331
    Walter Roberson
    May 1, 2006
  3. shruti

    problem including perl header files

    shruti, May 15, 2006, in forum: C Programming
    Replies:
    2
    Views:
    470
    Keith Thompson
    May 15, 2006
  4. shruti

    problem including header files in TC

    shruti, May 15, 2006, in forum: C Programming
    Replies:
    1
    Views:
    434
    Flash Gordon
    May 15, 2006
  5. mlt
    Replies:
    2
    Views:
    880
    Jean-Marc Bourguet
    Jan 31, 2009
Loading...

Share This Page