CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Need help to call perl module from C/C++ code without loading the perl libraries

 



muraliv
New User

Oct 2, 2012, 4:10 AM

Post #1 of 4 (3220 views)
Need help to call perl module from C/C++ code without loading the perl libraries Can't Post

Hi,

I am new to perl. I have a requirement to call a perl module from C/C++ code without loading the perl libraries. I am not supposed to use the "system" call also. I am looking something similar to "dlopen" call which we use to load the shared libraries dynamically from a C/C++ code. Basically I wanted to keep perl and C/C++ code independently. Generally we can embed the perl into C/C++ code by including the include files EXTERN.h and perl.h. While compiling the C/C++ code, we need to provide the perl libraries. As per my requirement, I am not supposed to provide any perl libraries while compiling the C/C++ code.

Any idea how to call perl module from C/C++ code without loading the perl libraries other than “system” call?

Thanks in advance.

Regards,
Murali


wickedxter
User

Oct 2, 2012, 12:34 PM

Post #2 of 4 (3207 views)
Re: [muraliv] Need help to call perl module from C/C++ code without loading the perl libraries [In reply to] Can't Post

I dont know nothing about c/c++ but i found this information that might help. http://perldoc.perl.org/perlxs.html


(This post was edited by wickedxter on Oct 2, 2012, 12:36 PM)


Laurent_R
Enthusiast / Moderator

Oct 2, 2012, 2:19 PM

Post #3 of 4 (3202 views)
Re: [wickedxter] Need help to call perl module from C/C++ code without loading the perl libraries [In reply to] Can't Post

Hmm, XS is more to work your route the other way around: writing a C or C++ extension to a Perl program.

The OP wants to write a Perl extension to a C program. I know that this is possible, but I have never done it, so I can't help much. But my understanding of what I quickly read on the subject was that you have to include the perl libraries. So, no idea on how to do it without including the libraries.


wickedxter
User

Oct 3, 2012, 1:59 PM

Post #4 of 4 (3182 views)
Re: [muraliv] Need help to call perl module from C/C++ code without loading the perl libraries [In reply to] Can't Post

http://docstore.mik.ua/orelly/perl/prog3/ch21_04.htm

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives