in reply to Can code using Inline and Inline::C be used as a Role with_traits in Moose?

...and that works very nicely too. In both cases they create an _Inline directory in the current working directory and the compiled c is written to that directory.

Um, you're only supposed to compile dlls once, when you install the module, not every time you run it -- extract the XS file Inline generates and get rid of Inline when uploading to CPAN

See

Re^2: How to get at perl's options in a program

InlineX::XS - Auto-convert Inline::C based modules to XS, InlineX::C2XS

InlineX::C2XS - Convert from Inline C code to XS

  • Comment on Re: Can code using Inline and Inline::C be used as a Role with_traits in Moose?

Replies are listed 'Best First'.
Re^2: Can code using Inline and Inline::C be used as a Role with_traits in Moose?
by DrewP (Initiate) on Sep 08, 2015 at 12:50 UTC

    Thank you, Anonymous, for your comments.

    My target is Linux so I think the point about compiling dlls is moot although please correct me if I am mistaken.

    Thanks, though, for the links to the XS converters. I will try them out and reply again if and when I have something working.

    At first glance it looks like the original Device::WH1091 module is in the wrong format to use without modification so I might as well try to work out what it does and see if I can re-write it to libusb 1.0 instead of the now deprecated libusb 0.1, which is the version it currently uses.

    ...I may be some time.

      My target is Linux so I think the point about compiling dlls is moot although please correct me if I am mistaken.

      Moot how?

      Why is it desireable that each CWD gets a copy of the module built for the occasion?

      Why is acceptable that "installing" a module isn't the end of the installation process?

      Oh look, maybe https://metacpan.org/pod/Inline#WRITING-MODULES-WITH-INLINE is slightly better than more appealing than my advice ... its certainly better than recompiling the module after installation ... but it adds a dependency for end users on Inline which isn't always easy to install (only author needs Inline to generate the XS, everybody after author doesn't need it)