<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi guys,<br><br>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:<br><br><blockquote>#!/usr/bin/perl -w<br><br>use Inline C;<br>use strict;<br><br>hello_inline();<br><br>__END__<br>__C__<br>#include <stdio.h><br><br>void hello_inline( ) {<br> printf( "Hello World. Best Regards from Inline\n" );<br>}<br></blockquote><br>The above code works fine, and the output is:<br><blockquote>plxc1000> test_c3.pl<br>Hello World. Best Regards from Inline<br></blockquote><br>However, the following code (adding the search.h header file):<br><br><blockquote>#!/usr/bin/perl -w<br><br>
use Inline C;<br>
use strict;<br><br>
hello_inline();<br><br>
__END__<br>
__C__<br>
#include <stdio.h><br>#include <search.h><br><br>
void hello_inline( ) {<br>
printf( "Hello World. Best Regards from Inline\n" );<br>
}<br></blockquote>
<br>Results in this output:<br><blockquote>plxc1000> test_c3.pl<br>/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<br>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<br>In file included from test_c3_pl_f52f.xs:6:<br>/usr/include/search.h:66: error: `Perl_push_scope' redeclared as different kind of symbol<br>/usr/lib/perl5/5.8.3/x86_64-linux-thread-multi/CORE/proto.h:590: error: previous declaration of `Perl_push_scope'<br>/usr/include/search.h:66: error: parse error before '(' token<br>make: *** [test_c3_pl_f52f.o] Error 1<br><br>A problem was encountered while attempting to compile and install your Inline<br>C code. The command that failed was:<br> make > out.make 2>&1<br></blockquote><br>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). <br><br>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!<br><br>Thomas<br><br><br /><hr />Insert movie times and more without leaving HotmailŪ. <a href='http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009' target='_new'>See how.</a></body>
</html>