{"id":1707,"date":"2017-10-13T18:24:43","date_gmt":"2017-10-13T09:24:43","guid":{"rendered":"http:\/\/www.chihayafuru.jp\/tech\/?p=1707"},"modified":"2017-10-13T18:24:43","modified_gmt":"2017-10-13T09:24:43","slug":"gcc%e3%81%ab%e3%81%a6-l-%e3%82%aa%e3%83%97%e3%82%b7%e3%83%a7%e3%83%b3%e3%82%92%e6%8c%87%e5%ae%9a%e3%81%99%e3%82%8b%e4%bd%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/1707","title":{"rendered":"gcc\u306b\u3066 -l \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u4f4d\u7f6e"},"content":{"rendered":"<p>gcc\u306b\u304a\u3044\u3066 <code>-l<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u4f4d\u7f6e\u306f\u610f\u5473\u3092\u6301\u3064\uff08\u8aa4\u3063\u305f\u4f4d\u7f6e\u3067\u6307\u5b9a\u3059\u308b\u3068\u30ea\u30f3\u30af\u30a8\u30e9\u30fc\u306b\u306a\u308b\uff09\u306e\u3067\u6ce8\u610f\u3059\u308b\u3053\u3068\uff01<\/p>\n<h2>-l \u3092\u53c2\u7167\u5143 listdevs.c (listdevs.o) \u306e\u524d\u306b\u8a18\u8ff0\u3059\u308b<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >$ gcc -o listdevs -I\/usr\/include\/libusb-1.0 -lusb-1.0 listdevs.c\r\n\/tmp\/ccy2LPhL.o: In function `print_devs':\r\nlistdevs.c:(.text+0x36): undefined reference to `libusb_get_device_descriptor'\r\nlistdevs.c:(.text+0x69): undefined reference to `libusb_get_device_address'\r\nlistdevs.c:(.text+0x7a): undefined reference to `libusb_get_bus_number'\r\nlistdevs.c:(.text+0xb3): undefined reference to `libusb_get_port_numbers'\r\n\/tmp\/ccy2LPhL.o: In function `main':\r\nlistdevs.c:(.text+0x178): undefined reference to `libusb_init'\r\nlistdevs.c:(.text+0x197): undefined reference to `libusb_get_device_list'\r\nlistdevs.c:(.text+0x1c5): undefined reference to `libusb_free_device_list'\r\nlistdevs.c:(.text+0x1d2): undefined reference to `libusb_exit'\r\ncollect2: error: ld returned 1 exit status<\/pre>\n<p>usb-1.0 (libusb-1.0.so) \u306e\u95a2\u6570\u304c\u53c2\u7167\u3067\u304d\u306a\u3044\uff08\u691c\u7d22\u5bfe\u8c61\u5916\u3068\u306a\u308b\uff09\u305f\u3081\u3001listdevs.o \u304b\u3089\u898b\u305f\u3068\u304d\u306b\u30ea\u30f3\u30af\u30a8\u30e9\u30fc(undefined reference)\u306b\u9665\u308b\u3002<br \/>\n<code>-l<\/code>\u3067\u6307\u5b9a\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u5148\u306b\u6307\u5b9a\u3057\u305f listdevs.c (listdevs.o) \u304b\u3089\u306f\u53c2\u7167\u3067\u304d\u306a\u3044\u3002<\/p>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<h2>-l \u3092\u53c2\u7167\u5143 listdevs.c (listdevs.o) \u306e\u5f8c\u306b\u8a18\u8ff0\u3059\u308b<\/h2>\n<pre class=\"lang:default highlight:0 decode:true \" >$ gcc -o listdevs -I\/usr\/include\/libusb-1.0 listdevs.c -lusb-1.0<\/pre>\n<p>\u30ea\u30f3\u30af\u306f\u6210\u529f\u3059\u308b\u3002lisdevs.o\u3092\u30ed\u30fc\u30c9\u3057\u305f\u5f8c\u306b -l \u3067\u6307\u5b9a\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u4e2d\u8eab\u3092\u53c2\u7167\uff08\u691c\u7d22\uff09\u3059\u308b\u305f\u3081\u3001\u3053\u306e\u30b1\u30fc\u30b9\u3067\u306f\u671f\u5f85\u901a\u308a\u306b\u30ea\u30f3\u30af\u304c\u6210\u529f\u3059\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>gcc\u306b\u304a\u3044\u3066 -l \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u4f4d\u7f6e\u306f\u610f\u5473\u3092\u6301\u3064\uff08\u8aa4\u3063\u305f\u4f4d\u7f6e\u3067\u6307\u5b9a\u3059\u308b\u3068\u30ea\u30f3\u30af\u30a8\u30e9\u30fc\u306b\u306a\u308b\uff09\u306e\u3067\u6ce8\u610f\u3059\u308b\u3053\u3068\uff01 -l \u3092\u53c2\u7167\u5143 listdevs.c (listdevs.o) \u306e\u524d\u306b\u8a18\u8ff0\u3059\u308b $ gcc -o  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[57],"class_list":["post-1707","post","type-post","status-publish","format-standard","hentry","category-memo","tag-gcc"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=1707"}],"version-history":[{"count":5,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1707\/revisions"}],"predecessor-version":[{"id":1712,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/1707\/revisions\/1712"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=1707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=1707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=1707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}