LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-20-2009, 09:10 AM   #1
cpp2quser
LQ Newbie
 
Registered: Mar 2009
Posts: 3

Rep: Reputation: 0
Question calling C/C++ function from perl


calling C/C++ function from perl

Hi,
how do I call a compiled C/C++ function from perl ?
Let say I have a C/C++ function:

Code:
*char func(char *ptr, int len) {
    ...
return str;}
Now i wonna call it from perl
 
Old 03-21-2009, 03:42 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,477

Rep: Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970Reputation: 3970
Quote:
Originally Posted by cpp2quser View Post
calling C/C++ function from perl

Hi,
how do I call a compiled C/C++ function from perl ?
Let say I have a C/C++ function:

Code:
*char func(char *ptr, int len) {
    ...
return str;}
Now i wonna call it from perl
Inline-0.44 from CPAN (which includes Inline::C), and there's also Inline::CPP. Or you may like to get straight into compiling XS code (which is more or less what Inline::C automates for you) - in which case you'd probably start with 'perldoc perlxstut'.

You can also look at http://www.swig.org It is "a relatively quick and painless way of exposing your C/C++ program's internal API to the machinations of any scripting language."

And since you're into programming, spelling correctly would certainly help too.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a function in javascript mohtasham1983 Programming 4 03-04-2008 04:13 PM
calling a function from within another function in php jayakrishnan Programming 2 06-19-2007 08:36 AM
calling a function by name in linux Four Programming 0 02-24-2007 11:19 PM
calling a function from a pointer spx2 Programming 3 05-25-2006 04:52 PM
Calling another function from a function using GTK geminigal Programming 4 07-11-2005 03:15 PM


All times are GMT -5. The time now is 10:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration