Perl から USB デバイスを使う。

環境 → Vine4.2

Device::USB というモジュールがあるらしい。

CPAN でインストール出来なかったのでしようとしたらエラー。README を読んで手で入れた。

はまったところ → libusb の devel がインストールされて無くて make エラー

インストールする。
apt-get install libusb-devel


出てたエラー

A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
make

The build directory was:
/root/.cpan/build/Device-USB-0.21-JHbECU/_Inline/build/Device/USB

To debug the problem, cd to the build directory, and inspect the output files.

at /root/.cpan/build/Device-USB-0.21-JHbECU/blib/lib/Device/USB.pm line 15
Compilation failed in require.
BEGIN failed–compilation aborted.
make: *** [USB.inl] エラー 2

ヒントはここに…。

Starting Build Compile Stage
Starting “perl Makefile.PL” Stage
Note (probably harmless): No library found for -lusb

Writing Makefile for Device::USB
Finished “perl Makefile.PL” Stage

ライブラリーが無いですよwww。と怒られてた。

相変わらず抜けてるなぁ。。

CPAN のテスターの人々がレポート書いてたけど同じ理由かと思う。