#navi(../)
* Ubuntu8.04でCソースのコンパイルができるようにする [#kf2ad0d1]
定番のHello Worldソースを作りコンパイルしようとしたところ、エラーメッセージが… :(
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* コンパイルを可能にするための手順
build-essentialをインストールすれば、Cソースをコンパイルする環境が構築できます。
-geditでhello.cを作成
#ref(gedit-hello_c.jpg)
-コンパイル結果
$ gcc hello.c
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function ‘main’:
hello.c:5: 警告: incompatible implicit declaration of built-in function ‘printf’
#ref(gcc-error.jpg)
** build-essentialパッケージをインストールすれば解決 [#e3aa8010]
&color(red){build-essential};をインストールすればコンパイルできる環境を構築できます。 :)
-Synapticを起動しbuild-essentialをインストール
#ref(synaptic-build-essential.jpg)
-インストールされるパッケージ
#ref(build-essential-install-pkgs.jpg)
**再度コンパイルし実行 [#b41825b8]
パッケージインストール後、無事コンパイルができました。 :)~
-コンパイルによって作成されたa.outを実行した結果
#ref(gcc-success.jpg)
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
#br