Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Using module with c code in perl program.

by stevieb (Canon)
on Dec 21, 2015 at 22:40 UTC ( #1150907=note: print w/replies, xml ) Need Help??


in reply to Re: Using module with c code in perl program.
in thread Using module with c code in perl program.

Out of curiosity, does quoting the requirement of Inline help? ie. use Inline 'C' ... I don't have access to Windows at the moment, so I can't test.

For that matter, kind of goes without saying, but you can compile a C program outside of Perl in your setup, yes?

Replies are listed 'Best First'.
Re^3: Using module with c code in perl program.
by Don Coyote (Hermit) on Dec 21, 2015 at 22:57 UTC

    the quoting does not make a difference. from the docs there are various ways of getting the code in. The problem seems to be more that the DATA handle is being read without being opened first.

    inside Inline, c_calc::DATA is aliased into Inline::DATA, and then read in after requiring Socket, but this is used just for CR and LF definitions. I hardcoded those definitions and commented out the Socket require, to no effect. then the subroutines goes on to read-in the aliased Inline::DATA. (my $data = <Inline::DATA>) =~ s/$CR?$LF/\n/g;

    I can compile a C program, using the gcc compiler which comes with Strawberry, I did so to ensure the C code was running before attempting to inline. This would indicate that I already have C compatibility from Strawberry, which makes the "not understanding C language" error contradictory.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1150907]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2023-03-22 16:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?