Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Inline::C with multiple *.c

by syphilis (Canon)
on Aug 24, 2012 at 01:12 UTC ( #989417=note: print w/ replies, xml ) Need Help??


in reply to Inline::C with multiple *.c

No problem for me with relative paths to 2 C files in the same directory:

C:\>type a.c void foo() { printf("Hello from foo\n"); } C:\>type b.c void bar() { printf("Hello from bar\n"); } C:\>type try.pl use warnings; use Inline C => "./a.c"; use Inline C => "./b.c"; foo(); bar(); C:\>perl try.pl Hello from foo Hello from bar C:\>
It may well be that relative paths need to begin with "./".

For LIBS and INC I think you do need to specify an absolute path which, for the cwd, should just be File::Spec->rel2abs('.')
And, yes, that would need to be done in a BEGIN block.

To me, that doesn't seem so bad - I guess it could always be improved.

Cheers,
Rob


Comment on Re: Inline::C with multiple *.c
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2015-07-01 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (12 votes), past polls