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: Intermediate:
I want to link a C (.so) file with perl using XS

 



CBRajesh
New User

Aug 30, 2013, 11:07 AM

Post #1 of 1 (985 views)
I want to link a C (.so) file with perl using XS Can't Post

Hi all ,

I am trying to call a C function within a .so file in perl .
I was able to generate the .xs , and also add code , I wrote a is_even(int) call in perl

#!/usr/bin/perl
use ExtUtils::testlib;
use test;
test::is_even($ARGV[0]);

No is_even() is in .xs file which on true calls a inline printf("Even") condition and false calls another main_print("Odd") . This main_print("Odd") is defined in a shared object (.so) file generated from a C file .

I am getting a
/usr/bin/perl: symbol lookup error: /home/abcd/perlPrac/test/blib/arch/auto/test/test.so: undefined symbol: main_print

Kindly need your suggestion as to make this work .. thanks in advance !

 
 


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

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