
Ubuntu日本語フォーラム

ログインしていません。
usb modeswitch で usb_modeswitch.c を gcc でコンパイルしました。
しかし、エラーがでました。
どのようなエラーなのでしょうか?
gcc がインストールされていないのでしょうか?
環境は
ubuntu 10.04
usb-modeswitch-1.1.2
です。
助けてください。
エラー;
]d9t5jg@d9t5jg-laptop:~/usb-modeswitch-1.1.2$ gcc -o mode-switch usb_modeswitch.cusb_modeswitch.c:66:17: error: usb.h: No such file or directory
usb_modeswitch.c: In function ‘main’:
usb_modeswitch.c:408: error: dereferencing pointer to incomplete type
usb_modeswitch.c:409: error: dereferencing pointer to incomplete type
usb_modeswitch.c:411: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:418: error: dereferencing pointer to incomplete type
usb_modeswitch.c:420: error: dereferencing pointer to incomplete type
usb_modeswitch.c:422: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘deviceDescription’:
usb_modeswitch.c:584: error: dereferencing pointer to incomplete type
usb_modeswitch.c:585: error: dereferencing pointer to incomplete type
usb_modeswitch.c:594: error: dereferencing pointer to incomplete type
usb_modeswitch.c:595: error: dereferencing pointer to incomplete type
usb_modeswitch.c:604: error: dereferencing pointer to incomplete type
usb_modeswitch.c:605: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘switchHuaweiMode’:
usb_modeswitch.c:794: error: ‘USB_TYPE_STANDARD’ undeclared (first use in this function)
usb_modeswitch.c:794: error: (Each undeclared identifier is reported only once
usb_modeswitch.c:794: error: for each function it appears in.)
usb_modeswitch.c:794: error: ‘USB_RECIP_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c:794: error: ‘USB_REQ_SET_FEATURE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘switchSonyMode’:
usb_modeswitch.c:880: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c: In function ‘checkSuccess’:
usb_modeswitch.c:1020: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1026: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1026: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘search_devices’:
usb_modeswitch.c:1134: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1134: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1136: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1136: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1138: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1138: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1139: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1160: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1167: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1167: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1169: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1179: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1188: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1190: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1193: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1194: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1220: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1220: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘find_first_bulk_output_endpoint’:
usb_modeswitch.c:1242: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1245: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1246: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1247: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1247: error: ‘USB_ENDPOINT_TYPE_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1247: error: ‘USB_ENDPOINT_TYPE_BULK’ undeclared (first use in this function)
usb_modeswitch.c:1248: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1248: error: ‘USB_ENDPOINT_DIR_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1249: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘find_first_bulk_input_endpoint’:
usb_modeswitch.c:1260: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1263: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1264: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1265: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1265: error: ‘USB_ENDPOINT_TYPE_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1265: error: ‘USB_ENDPOINT_TYPE_BULK’ undeclared (first use in this function)
usb_modeswitch.c:1266: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1266: error: ‘USB_ENDPOINT_DIR_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1267: error: dereferencing pointer to incomplete type
オフライン
コピペの仕方を間違えたのか、見にくくなってしまっていますが、
usb_modeswitch.c:66:17: error: usb.h: No such file or directory
が最初のエラーのようです。つまりusb.hが見つかりませんということです。
端末で、
$ uname -a
などとして使用中のカーネルの種類を調べ、例えば、2.6.32-22-genericとかであったとすると、パッケージマネージャで、
linux-headers-generic
を探してインストールしてみて下さい。
すでにインストール済みなのに、同じエラーがでる場合は、コンパイル時にInclude pathが適切に設定されていないのかも知れません。
なにをどのように入手して、どのようにしてコンパイルしようとしているのか、など、詳細な情報を投稿下さい。
なお、aptitude, apt-cacheでパッケージを検索してみたところ、
$ aptitude search modeswitch p usb-modeswitch - mode switching tool for controlling "flip flop" p usb-modeswitch-data - mode switching data for usb-modeswitch
$ apt-cache policy usb-modeswitch
usb-modeswitch:
インストールされているバージョン: (なし)
候補: 1.1.0-2
バージョンテーブル:
1.1.0-2 0
500 http://jp.archive.ubuntu.com/ubuntu/ lucid/universe Packagesとなっており、特に修正や変更を加えたいなど特別な事情が無い限りは、システムの他の部分と不整合をおこさないため、パッケージからのインストールをお勧めします。
これより新しいバージョンが必要などの場合も、PPAなどで新しいパッケージが公開されていないか探した方がよいかと思います。
オフライン
書き忘れました。
$ sudo apt-get build-dep usb-modeswitch
で、usb-modeswitchの1.1.0をビルドするのに必要なもの一式がインストールされるかと思います。
詳細は、ソース付属文書を読まないといけませんが、1.1.2もビルドできる環境になっているかも知れません。
オフライン
usb-modeswitch-1.1.0-2 というパッケージが ubuntu のホームページよりダウンロード、インストールができました。
しかし、そのパッケージからusb_modeswitch.conf という設定ファイルを見つけられません。
オフライン
入手先のホームページです。
http://packages.ubuntu.com/ja/
オフライン
少なくともubuntuでは、デフォルトのusb_modeswitch.confは無いようです。
オフライン
usb_modeswitch.confを設定するにはどうしたらよいですか?
オフライン
tcz562qpeb1 による投稿:
usb_modeswitch.confを設定するにはどうしたらよいですか?
https://forums.ubuntulinux.jp/viewtopic.php?pid=61231#p61231
最近、tcz562qpeb1さんが立てた複数のトピックについてですが、本当にやりたい内容は共通しているように思えます。
環境や、やりたいことを整理して、ひとつのトピックで集中してやった方が、よいのではないでしょうか。
オフライン
そうでした。失礼しました。次回からそうします。
オフライン