Hi Dieter,

[EMAIL PROTECTED] [20/02/02 19:55 +0100]:
> Hi,
> 
> I'am trying to use "Inline C" with Active Perl Build 630. Inline V0.43,
> Digest-MD5 V2.16,
> Inline-Files V0.60, Inline Struct V0.06 with W2K and servicePack 2.
> 
> I would like to embed the following smal C-Program
> 
> use  Inline C;
> Hello;
> __END__
> __C__
> Hello(){
> printf("Hello World\n");
> }

Inline::C requires you to specify a return type for functions. Although pure
C defaults to a return type of 'int' if you don't specify it, Inline::C won't
bind to such functions.

Note also that because Inline::C doesn't prototype 'Hello', the bareword
'Hello' is interpreted as a string, and prompts the warning "Useless use of a
constant in void context at foo.pl line 2."

This code works fine:

----8<----
use Inline C;
Hello();

__END__
__C__

void Hello() {
    printf("Hello World\n");
}
---->8----

Later,
Neil

Reply via email to