472,370 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,370 software developers and data experts.

problem including perl header files

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 '06 #1
2 3389
shruti 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.
Using the system command is the only method provided by the C standard.
However, you've not provided the code for that so we can't comment on
what you might have done wrong.
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
*/
<snip>

This is nothing to do with standard C, if you want to know how to embed
Perl ask in a Perl group or mailing list.
now wat happens is that it gives error tht it does not recognise perl.h
and extern.h
That is almost always the wrong thing to do.
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!!!


I'm sure there is a method, although whether you can call a modern build
of Perl with such an ancient compiler is another matter. For how to use
Turbo C either read the documentation or ask in a Boreland group.
--
Flash Gordon, living in interesting times.
Web site - http://home.flash-gordon.me.uk/
comp.lang.c posting guidelines and intro:
http://clc-wiki.net/wiki/Intro_to_clc
May 15 '06 #2
"shruti" <sh************@gmail.com> writes:
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.
Then you're doing it wrong. Without seeing what your call to system()
looks like, we can't possibly guess *what* you're doing wrong.
2.By using the code given in perldoc perlembed(perl documentation for
embedding perl in C)
the code looks like this- [snip] 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.
Copying header files is almost certainly not what you want to do.

You need to tell your compiler where to find the existing header
files. Once you figure out how to do that, you'll also need to tell
your compiler and/or linker where to find the libraries.
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!!!


There probably is a way to do that. I have no idea what it is. It's
a question about Turbo C, not about the C programming language. I
presume Turbo C includes documentation. If not, find a forum
(newsgroup, web site, mailing list, whatever) that discusses Turbo C.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
May 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Tim Ward | last post by:
I'm trying to make an image which is a chart of some data. The graphics code on its own works fine - this is a file which in outline is: <?php Header ('Content-Type: image/png'); $img =...
11
by: cppaddict | last post by:
Say that your CustomClass.h header files requires #include <string> Now say that your CustomClass.cpp file also requires string. Is it good form to repeat the <string> include to make the...
14
by: Murkland | last post by:
Hi. I have a problem with a template class that I'm trying to inherit from. The code for the base class is: template <class T> class BaseClass { public: BaseClass(); ~BaseClass();
102
by: hug | last post by:
www.webmaster, was suggested that this ng could be a better place.] I've updated my test server to handle if-modified-since. I've noticed that the (old copies I run of) IE and Netscape seem...
1
by: shruti | last post by:
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...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
7
by: The Cool Giraffe | last post by:
I have the following: //A.h class A {}; //B.h #include "A.h" class B : A {};
4
by: jonathan184 | last post by:
Hi I have a perl script, basically what it is suppose to do is check a folder with files. Now the files are checked using a timestamp with the command ls -l so the timestamp in this format is...
13
by: Rohit | last post by:
Is there any way by which I can find number of elements in an enum list? Generally I use one last element at the end to find out total number of elements. e.g. typedef enum{ SUN, MON, TUE,...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.