{"componentChunkName":"component---src-templates-post-template-js","path":"/posts/where-are-c-header-files","result":{"data":{"markdownRemark":{"id":"14ef50d5-0816-592b-bbe3-adadb9418106","html":"<p>例えば Ruby や Python などで MySQL のクライアントライブラリを入れようとしたりすると、C 言語のヘッダファイル (&#x3C;なんとか>.h) がないというエラーになったりすることがあります。</p>\n<p>そういった際はなんとなくググって解決できることも多いですが、根本的には必要なファイルを探す方法を身につけることが望ましいです。</p>\n<p>そこでこの記事には、</p>\n<ul>\n<li>C 言語のヘッダファイルがどこにあるのか</li>\n<li>「&#x3C;なんとか>.h」をインストールする方法</li>\n</ul>\n<p>について、自分に分かる範囲で書いていきます。</p>\n<h2 id=\"検証環境\" style=\"position:relative;\"><a href=\"#%E6%A4%9C%E8%A8%BC%E7%92%B0%E5%A2%83\" aria-label=\"検証環境 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>検証環境</h2>\n<p>まずは、検証環境について載せておきます。\n(Ubuntu 20.04 です)</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">$ uname -a\nLinux oshima-desktop 5.13.0-52-generic #59~20.04.1-Ubuntu SMP Thu Jun 16 21:21:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux\n$ gcc --version\ngcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0\nCopyright (C) 2019 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</code></pre></div>\n<h2 id=\"そもそも-c-言語のヘッダファイルはどこにあるのか\" style=\"position:relative;\"><a href=\"#%E3%81%9D%E3%82%82%E3%81%9D%E3%82%82-c-%E8%A8%80%E8%AA%9E%E3%81%AE%E3%83%98%E3%83%83%E3%83%80%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AF%E3%81%A9%E3%81%93%E3%81%AB%E3%81%82%E3%82%8B%E3%81%AE%E3%81%8B\" aria-label=\"そもそも c 言語のヘッダファイルはどこにあるのか permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>そもそも C 言語のヘッダファイルはどこにあるのか</h2>\n<p>さて、それではまず前提として、C 言語のヘッダファイルがどこにあるのかから見ていきます。</p>\n<p>Google などで調べてみてもいいですが、「C 言語のコンパイル時にも参照されているはず」というアイデアで見てみようと思います。</p>\n<p>まずは C 言語のサンプルコードを作成します。</p>\n<div class=\"gatsby-highlight\" data-language=\"c\"><pre class=\"language-c\"><code class=\"language-c\"><span class=\"token macro property\"><span class=\"token directive-hash\">#</span><span class=\"token directive keyword\">include</span> <span class=\"token string\">&lt;stdio.h></span></span>\n\n<span class=\"token keyword\">int</span> <span class=\"token function\">main</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span>\n<span class=\"token punctuation\">{</span>\n  <span class=\"token function\">printf</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"Hello world!\\n\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n  <span class=\"token function\">exit</span><span class=\"token punctuation\">(</span><span class=\"token number\">0</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>gcc でコンパイルします。</p>\n<p>このとき、-v オプションで実行の詳細を表示してみます。</p>\n<div class=\"gatsby-highlight\" data-language=\"console\"><pre class=\"language-console\"><code class=\"language-console\">$ gcc -o hello hello.c -v\nUsing built-in specs.\nCOLLECT_GCC=gcc\nCOLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper\nOFFLOAD_TARGET_NAMES=nvptx-none:hsa\nOFFLOAD_TARGET_DEFAULT=1\nTarget: x86_64-linux-gnu\nConfigured with: ../src/configure -v --with-pkgversion=&#39;Ubuntu 9.4.0-1ubuntu1~20.04.1&#39; --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu\nThread model: posix\ngcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1) \nCOLLECT_GCC_OPTIONS=&#39;-o&#39; &#39;hello&#39; &#39;-v&#39; &#39;-mtune=generic&#39; &#39;-march=x86-64&#39;\n /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -quiet -v -imultiarch x86_64-linux-gnu hello.c -quiet -dumpbase hello.c -mtune=generic -march=x86-64 -auxbase hello -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cceK2Ql4.s\nGNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)\n\tcompiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP\n\nGGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072\nignoring nonexistent directory &quot;/usr/local/include/x86_64-linux-gnu&quot;\nignoring nonexistent directory &quot;/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed&quot;\nignoring nonexistent directory &quot;/usr/lib/gcc/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/include&quot;\n#include &quot;...&quot; search starts here:\n#include &lt;...&gt; search starts here:\n /usr/lib/gcc/x86_64-linux-gnu/9/include\n /usr/local/include\n /usr/include/x86_64-linux-gnu\n /usr/include\nEnd of search list.\nGNU C17 (Ubuntu 9.4.0-1ubuntu1~20.04.1) version 9.4.0 (x86_64-linux-gnu)\n\tcompiled by GNU C version 9.4.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP\n\nGGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072\nCompiler executable checksum: c0c95c0b4209efec1c1892d5ff24030b\nhello.c: In function ‘main’:\nhello.c:6:3: warning: implicit declaration of function ‘exit’ [-Wimplicit-function-declaration]\n    6 |   exit(0);\n      |   ^~~~\nhello.c:6:3: warning: incompatible implicit declaration of built-in function ‘exit’\nhello.c:2:1: note: include ‘&lt;stdlib.h&gt;’ or provide a declaration of ‘exit’\n    1 | #include &lt;stdio.h&gt;\n  +++ |+#include &lt;stdlib.h&gt;\n    2 | \nCOLLECT_GCC_OPTIONS=&#39;-o&#39; &#39;hello&#39; &#39;-v&#39; &#39;-mtune=generic&#39; &#39;-march=x86-64&#39;\n as -v --64 -o /tmp/ccolkcv4.o /tmp/cceK2Ql4.s\nGNU アセンブラ バージョン 2.34 (x86_64-linux-gnu)、BFD バージョン (GNU Binutils for Ubuntu) 2.34 を使用\nCOMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/\nLIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/\nCOLLECT_GCC_OPTIONS=&#39;-o&#39; &#39;hello&#39; &#39;-v&#39; &#39;-mtune=generic&#39; &#39;-march=x86-64&#39;\n /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/cczXFzh6.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o hello /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. /tmp/ccolkcv4.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o\nCOLLECT_GCC_OPTIONS=&#39;-o&#39; &#39;hello&#39; &#39;-v&#39; &#39;-mtune=generic&#39; &#39;-march=x86-64&#39;</code></pre></div>\n<p>この中を見てみると、</p>\n<div class=\"gatsby-highlight\" data-language=\"console\"><pre class=\"language-console\"><code class=\"language-console\"> /usr/lib/gcc/x86_64-linux-gnu/9/cc1 -quiet -v -imultiarch x86_64-linux-gnu hello.c -quiet -dumpbase hello.c -mtune=generic -march=x86-64 -auxbase hello -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cceK2Ql4.s</code></pre></div>\n<p>という箇所で実際のコンパイラ (cc1) が実行されているようです。</p>\n<p>※ gcc は広義では「コンパイラ」ですが、実際には内部で狭義のコンパイラ (cc1) やアセンブラ (as)、リンカなど (collect2) を呼び出しており、「コンパイラドライバ」と呼ばれることもあるそうです。</p>\n<p>さて、cc1 の実行以降の出力を見てみると…</p>\n<div class=\"gatsby-highlight\" data-language=\"console\"><pre class=\"language-console\"><code class=\"language-console\">#include &quot;...&quot; search starts here:\n#include &lt;...&gt; search starts here:\n /usr/lib/gcc/x86_64-linux-gnu/9/include\n /usr/local/include\n /usr/include/x86_64-linux-gnu\n /usr/include\nEnd of search list.</code></pre></div>\n<p>ということで、<code class=\"language-text\">#include</code> の検索をしている箇所が見つかりました。</p>\n<p>ここに表示されているパスから、ヘッダファイルを探しているようですね。</p>\n<p>ls などで見てみると、たしかにヘッダファイルが見つかります。</p>\n<h2 id=\"必要なヘッダファイルをインストールするには\" style=\"position:relative;\"><a href=\"#%E5%BF%85%E8%A6%81%E3%81%AA%E3%83%98%E3%83%83%E3%83%80%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF\" aria-label=\"必要なヘッダファイルをインストールするには permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>必要なヘッダファイルをインストールするには</h2>\n<p>ここから、不足しているヘッダファイルを探してインストールする方法を書いていきます。</p>\n<p>例えば Ruby や Python などで MySQL のクライアントライブラリを使いたい場合に、C 言語のヘッダファイルがないというエラーになったりすることがあります。</p>\n<p>そんな例であれば、</p>\n<div class=\"gatsby-highlight\" data-language=\"console\"><pre class=\"language-console\"><code class=\"language-console\">$ sudo apt install libmariadb-dev</code></pre></div>\n<p>のようにして、libmariadb-dev などをインストールして解決することになります。</p>\n<p>これは、求められているヘッダファイルが libmariadb-dev に含まれているためです。</p>\n<p>libmariadb-dev に含まれているファイルは、以下のように見ることができます。</p>\n<div class=\"gatsby-highlight\" data-language=\"console\"><pre class=\"language-console\"><code class=\"language-console\">$ dpkg -L libmariadb-dev \n/.\n/usr\n/usr/bin\n/usr/bin/mariadb_config\n/usr/include\n/usr/include/mariadb\n    :\n/usr/include/mariadb/mysql.h\n    :</code></pre></div>\n<p>ということで、libmariadb-dev をインストールすると、やはり /usr/include 以下にヘッダファイルが配置されるようですね。</p>\n<p>本来はこれとは逆で、あるヘッダファイルを含むパッケージを知りたいはずです。</p>\n<p>apt-file コマンドを使うことで、指定したヘッダファイルを含むパッケージを検索できます。</p>\n<div class=\"gatsby-highlight\" data-language=\"console\"><pre class=\"language-console\"><code class=\"language-console\">$ apt-file search mysql.h\n    :\nlibgdal-doc: /usr/share/doc/libgdal-doc/gdal/drv_mysql.html\nlibgearman-doc: /usr/share/doc/libgearman-doc/html/gearmand/queues/mysql.html\nlibmariadb-dev: /usr/include/mariadb/mysql.h\nlibmariadb-dev: /usr/include/mariadb/server/mysql.h\nlibmariadb-dev: /usr/include/mariadb/server/private/probes_mysql.h\nlibmysqlclient-dev: /usr/include/mysql/mysql.h\nlibodb-api-dev: /usr/include/x86_64-linux-gnu/mysql.h\n    :</code></pre></div>\n<p>mysql.h と検索してみましたが、libmariadb-dev 以外にも大量のパッケージが見つかりました。</p>\n<h2 id=\"おわりに\" style=\"position:relative;\"><a href=\"#%E3%81%8A%E3%82%8F%E3%82%8A%E3%81%AB\" aria-label=\"おわりに permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>おわりに</h2>\n<p>以上、C 言語のヘッダファイルの在り処と、「&#x3C;なんとか>.h」がないというエラーへの対応について見てきました。</p>\n<p>このあたりは個人的になんとなくやっていた部分があるので、もっと知識をつけていこうと思います。</p>\n<h2 id=\"関連書籍\" style=\"position:relative;\"><a href=\"#%E9%96%A2%E9%80%A3%E6%9B%B8%E7%B1%8D\" aria-label=\"関連書籍 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>関連書籍</h2>\n<p><a href=\"https://amzn.to/3OYFcpN\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">リンカ・ローダ実践開発テクニック</a></p>\n<p><a href=\"https://www.amazon.co.jp/%E3%83%AA%E3%83%B3%E3%82%AB%E3%83%BB%E3%83%AD%E3%83%BC%E3%83%80%E5%AE%9F%E8%B7%B5%E9%96%8B%E7%99%BA%E3%83%86%E3%82%AF%E3%83%8B%E3%83%83%E3%82%AF%E2%80%95%E5%AE%9F%E8%A1%8C%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AB%E5%BF%85%E9%A0%88%E3%81%AE%E6%8A%80%E8%A1%93-COMPUTER-TECHNOLOGY-%E5%9D%82%E4%BA%95-%E5%BC%98%E4%BA%AE/dp/4789838072?crid=160JVBUV9M3O7&keywords=%E3%83%AA%E3%83%B3%E3%82%AB%E3%83%AD%E3%83%BC%E3%83%80&qid=1657463144&sprefix=%E3%83%AA%E3%83%B3%E3%82%AB%E3%83%AD%E3%83%BC%E3%83%80%2Caps%2C182&sr=8-1&linkCode=li1&tag=oshimayuki0d-22&linkId=3287ac58beef302e2149e34712f99c6d&ref_=as_li_ss_il\" target=\"_blank\"><img border=\"0\" src=\"//ws-fe.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=4789838072&Format=_SL110_&ID=AsinImage&MarketPlace=JP&ServiceVersion=20070822&WS=1&tag=oshimayuki0d-22\" ></a><img src=\"https://ir-jp.amazon-adsystem.com/e/ir?t=oshimayuki0d-22&amp;l=li1&amp;o=9&amp;a=4789838072\" width=\"1\" height=\"1\" border=\"0\" alt=\"\" style=\"border:none !important; margin:0px !important;\"></p>","fields":{"slug":"/posts/where-are-c-header-files","tagSlugs":["/tag/linux/","/tag/c/"],"autoRecommendPosts":["what-is-installation","what-is-executing-a-command-on-bash","command-collection-for-binary-files","linux-next-step-books"]},"frontmatter":{"date":"2022-07-10T14:58:42.419Z","description":"例えば Ruby や Python などで MySQL のクライアントライブラリを入れようとしたりすると、C 言語のヘッダファイル (<なんとか>.h) がないというエラーになったりすることがあります。\nそういった際はなんとなくググって解決できることも多いですが、根本的には必要なファイルを探す方法を身につけることが望ましいです。\nそこでこの記事には、C 言語のヘッダファイルがどこにあるのか、「<なんとか>.h」をインストールする方法、について、自分に分かる範囲で書いていきます。","tags":["linux","c"],"title":"C 言語のヘッダファイルの在り処と、「<なんとか>.h」がないというエラーへの対応について","socialImage":null,"recommendPosts":null}}},"pageContext":{"slug":"/posts/where-are-c-header-files"}},"staticQueryHashes":["251939775","3942705351","401334301"]}