[Pdx-pm] Inline::C search.h 'Perl_push_scope'

Thomas Thompson vortix at hotmail.com
Mon May 11 13:49:16 PDT 2009


Hi guys,

This is my first post to this list.  I'm not an expert in Perl and definitely a beginner with C.  I'm trying to rewrite a short section of some Perl code in C, but I've bumped into the following issue:

#!/usr/bin/perl -w

use Inline C;
use strict;

hello_inline();

__END__
__C__
#include <stdio.h>

void hello_inline( ) {
        printf( "Hello World. Best Regards from Inline\n" );
}

The above code works fine, and the output is:
plxc1000> test_c3.pl
Hello World. Best Regards from Inline

However, the following code (adding the search.h header file):

#!/usr/bin/perl -w


use Inline C;

use strict;


hello_inline();


__END__

__C__

#include <stdio.h>
#include <search.h>


void hello_inline( ) {

        printf( "Hello World. Best Regards from Inline\n" );

}





Results in this output:
plxc1000> test_c3.pl
/usr/bin/perl /usr/lib/perl5/5.8.3/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.3/ExtUtils/typemap   test_c3_pl_f52f.xs > test_c3_pl_f52f.xsc && mv test_c3_pl_f52f.xsc test_c3_pl_f52f.c
cc -c  -I/nfs/pdx/disks/nehalem.pde.077/projects/rapttr/src -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -fmessage-length=0 -Wall -Wall -pipe   -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" -fPIC "-I/usr/lib/perl5/5.8.3/x86_64-linux-thread-multi/CORE"   test_c3_pl_f52f.c
In file included from test_c3_pl_f52f.xs:6:
/usr/include/search.h:66: error: `Perl_push_scope' redeclared as different kind of symbol
/usr/lib/perl5/5.8.3/x86_64-linux-thread-multi/CORE/proto.h:590: error: previous declaration of `Perl_push_scope'
/usr/include/search.h:66: error: parse error before '(' token
make: *** [test_c3_pl_f52f.o] Error 1

A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
  make > out.make 2>&1

Looking through the search.h header file, I don't see any instance of Perl_push_scope being redeclared, especially not on line 66 (which seems to be the middle of an enum type declaration).  I have not modified any of these header files.  This is on SUSE LINUX Enterprise Server 9 (x86_64).  

Any ideas to help out a new guy? :)  Let me know if I missed information I should provide when asking this type of question and I'll make certain to make certain to provide everything you guys need in the future.  I appreciate the help!

Thomas


_________________________________________________________________
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/pdx-pm-list/attachments/20090511/0ccd3884/attachment.html>


More information about the Pdx-pm-list mailing list