Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Inline::C with multiple *.c

by Anonymous Monk
on Aug 24, 2012 at 08:13 UTC ( #989450=note: print w/replies, xml ) Need Help??

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

Is there a better way?

Yes, chdir

#!/usr/bin/perl -- use Path::Class; use constant THISFILE => "".file( __FILE__ )->absolute; use constant THISDIR => "".file( THISFILE )->dir; BEGIN { chdir THISDIR or die $!; } use Inline ( C => Config => LIBS => "-Llib/relative -lrelative", INC => "-Iinc/relative", BUILD_NOISY => 1, CLEAN_AFTER_BUILD => 0, DIRECTORY => 'RELATIVE', # INVALID VALUE?! IT MUST EXIST ); use Inline C => file('a.c')->absolute, qw' NAME RelativeA '; use Inline C => file('b.c')->absolute, qw' NAME RelativeB '; use strict; use warnings; ...

See also swd, Toolkit, Syntax::Collector...

Replies are listed 'Best First'.
Re^2: Inline::C with multiple *.c
by gri6507 (Deacon) on Aug 24, 2012 at 12:35 UTC
    Thanks, your syntax does seem much cleaner and more intuitive.

    However, I just stumbled across another odd problem. I just changed my b.c so that it calls a function from a.c. Since a.c is built first, it generates a DLL (I'm doing this on Windows under Strawberry Perl). Next, when building b.c, it has to be linked against the first DLL. But I can't specify that in the config section above because it's common to all Inline::C files and clearly that DLL does not yet exist when compiling/linking a.c.

    Any suggestions?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://989450]
[Discipulus]: my warmest comprehension karlgoethebier ;=(
[Discipulus]: yes LanX.. is so good to be appreciated (I fortunately have a big self estimation that compensate)
[LanX]: you can manipulate a html tree by addressing and replacing so called document objects (DOM) and from my experience the same methods can be used with any XML, though I didn't test all browsers yet
LanX just joking, playing "ego judo"
[marto]: good morning all
[Corion]: Hi marto!
[marto]: the race to the bottom continues, many people lost their job yesterday as a client moves to another outsourcer
[LanX]: brexit or perlxit ?
[Corion]: Ow, marto :-/ I hope you aren't affected (except for the looming dread of more work for the same pay)
[marto]: unrelated

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2017-03-23 09:54 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (285 votes). Check out past polls.