{"id":2811,"date":"2018-11-23T12:50:29","date_gmt":"2018-11-23T03:50:29","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=2811"},"modified":"2018-11-23T12:50:29","modified_gmt":"2018-11-23T03:50:29","slug":"gcc-undefined-reference-to-log10","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/2811","title":{"rendered":"[gcc] undefined reference to log10"},"content":{"rendered":"<h3>1. \u75c7\u72b6<\/h3>\n<p>log10() \u3092\u547c\u3073\u51fa\u3059\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3002<\/p>\n<pre class=\"lang:default highlight:0 decode:true \" >$ gcc main.c\r\n\/tmp\/ccuhFgLT.o: In function `main':\r\nmain.c:(.text+0x4d): undefined reference to `log10'\r\nmain.c:(.text+0x75): undefined reference to `log10'\r\ncollect2: error: ld returned 1 exit status<\/pre>\n<p><!--more--><\/p>\n<h3>2. \u539f\u56e0<\/h3>\n<p>math\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30ea\u30f3\u30af (<code> -lm <\/code>) \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044<\/p>\n<h3>3. \u89e3\u6c7a\u7b56\u4f8b<\/h3>\n<pre class=\"lang:default highlight:0 decode:true \" >$ gcc main.c -lm -o main<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. \u75c7\u72b6 log10() \u3092\u547c\u3073\u51fa\u3059\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3002 $ gcc main.c \/tmp\/ccuhFgLT.o: In function `main&#8217;: main.c:(.te [&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":[80],"class_list":["post-2811","post","type-post","status-publish","format-standard","hentry","category-memo","tag-c"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/2811","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=2811"}],"version-history":[{"count":4,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/2811\/revisions"}],"predecessor-version":[{"id":2821,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/2811\/revisions\/2821"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=2811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=2811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=2811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}