gccを簡単にインストールする方法とは?

このQ&Aのポイント
  • turboLinux10Dにgccをインストールする方法を調べています。
  • インストール方法を試していると、./configureコマンド実行時にエラーが発生します。
  • エラーメッセージには、ccコマンドが見つからないという内容が表示されます。
回答を見る
  • ベストアンサー

gccをインストールしたい

turobLinux10Dにgccをインストールしたいと思い、 http://www.cityfujisawa.ne.jp/~odagiri/book/gcc.htm を見ながらやってるのですが、 ./configure とうつと [root@localhost gcc-3.3.2]# ./configure Configuring for a i686-pc-linux-gnu host. Created "Makefile" in /root/Desktop/gcc-3.3.2 using "mt-frag" ./configure: cc: command not found *** The command 'cc -o conftest -g conftest.c' failed. *** You must set the environment variable CC to a working compiler. [root@localhost gcc-3.3.2]# とでてきます。 これはどういった意味でしょうか? お願いします。 なぜccがでてくるのでしょうか? ちなみにCDからでもできますが、こちらの方が 勉強になるとおもいやってます。

質問者が選んだベストアンサー

  • ベストアンサー
  • jacta
  • ベストアンサー率26% (845/3158)
回答No.2

> bash: gcc: command not found > と出てきます。 > これはどういう事でしょうか? GCCがインストールされていません。あるいは、インストールはされているものの、何らかの理由で機能していません。

Judau_MSZ-010
質問者

お礼

ありがとうございます。

その他の回答 (1)

  • jacta
  • ベストアンサー率26% (845/3158)
回答No.1

GCCをソースからインストールするためにはCコンパイラが必要になります。 Linuxの場合、標準のCコンパイラはGCCですから、まずはCDからGCCをインストールしてください。 「勉強になるから」とのことであれば、まずCDからGCCをインストールし、その後、最新版のGCCをインストールするなどしてください。

Judau_MSZ-010
質問者

補足

ありがとうございます。 man gcc とうつと説明がでてくるのですが、 gccとコマンドを打っても bash: gcc: command not found と出てきます。 これはどういう事でしょうか? お願いします。

関連するQ&A

  • GCCでライブラリが足りない

    はじめまして。 LindowsOS4.0を使っています。 コンパイルができずに困っています。 GCCとMAKEをインストールしました(Lindowsはどちらも入っていないのです。Debian/Woodyベースと言われています)。 gcc 2.95.4 make 3.79.1 which gcc とすると、/usr/bin/gcc と表示されます。 で、./configure すると、 ..... checking whether the C compiler works ... no と表示されコンパイルエラーになります。 configure.log を見ると、 ------------------- checking for gcc configure:916: checking whether the C compiler (gcc ) works configure:932: gcc -o conftest conftest.c 1>&5 /usr/bin/ld: cannot open crt1.o: No such file or directory collect2: ld returned 1 exit status configure: failed program was: #line 927 "configure" #include "confdefs.h" main(){return(0);} --------------------- とか --------------------- checking for gcc configure:905: checking whether the C compiler (gcc ) works configure:921: gcc -o conftest conftest.c 1>&5 /usr/bin/ld: cannot open crt1.o: No such file or directory collect2: ld returned 1 exit status configure: failed program was: #line 916 "configure" #include "confdefs.h" main(){return(0);} ---------------------- とかなっています。 confdefs.hというのは何かのライブラリなのでしょうか?これが無いとconfigureできないのでしょうか?? よろしくお願いいたします。

  • Fedora Core3でApacheのインストール

    お世話になります。 これからLinuxを勉強しようと思い、Fedora Core3 をインストールをしまして、Apache2をFedora Core3の パッケージではなく、他のCDからインストールを しようとしましたら、うまくいかずに困っています。 原因はどのようなことなのでしょうか。 よろしくお願いいたします。 コマンド文はこのようになっていました。 [root@localhost httpd-2.0.50]# ./configure --enable-so checking for chosen layout... Apache checking for working mkdir -p... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu Configuring Apache Portable Runtime library ... checking for APR... reconfig configuring package in srclib/apr now checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu Configuring APR library Platform: i686-pc-linux-gnu checking for working mkdir -p... yes APR Version: 0.9.5 checking for chosen layout... apr checking for gcc... no checking for cc... no checking for cc... no checking for cl... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. configure failed for srclib/apr [root@localhost httpd-2.0.50]# make make: *** ターゲットが指定されておらず、makefile も見つかりません。中止。 [root@localhost httpd-2.0.50]#

  • phpのインストール

    fedora core1にphp4。3。6をインストール中です。 makeのターゲットの指定とはどうやったらいいのですか? [root@ocn src]# cd php-4.3.6 [root@ocn php-4.3.6]# ./configure --with-pgsql \ > --enable-mbstring \ > --enable-mbregex \ > --with-apxs=/opt/apache/bin/apxs creating cache ./config.cache checking host system type... i686-pc-linux-gnu checking for gcc... gcc checking whetherthe C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc accepts -g... yes checking whether gcc and cc understand -c and -o together... yes checking how to run the C preprocessor... gcc -E checking for AIX... no checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking for re2c... exit 0; checking for ranlib... ranlib checking whether ln -s works... yes checking for mawk... no checking for gawk... gawk checking for bison... no checking for byacc... no configure: warning: You will need bison if you want to regenerate the PHP parsers. checking for flex... lex checking for yywrap in -ll... no checking lex output file root... ./configure: line 2425: lex: command not found configure: error: cannot find output from lex; giving up You have new mail in /var/spool/mail/root [root@ocn php-4.3.6]# make make: *** ターゲットが指定されておらず、makefile が見つかりません. 中止。

  • cygwin上の開発環境構築時のエラーについて

    cygwin+gccでh8の開発環境を作ろうと思っているのですが、 binutilsをtarコマンドで展開した後、コンパイルとインストールで 以下のようなエラーが出て前へ進めません。 どのようにしたらよいのでしょうか? $ cd /usr/local/src/binutils-2.14 $ mkdir work $ cd work $ ../configure --target=h8300-hms --prefix=/usr/local/h8 loading cache ./config.cache checking host system type... i686-pc-cygwin checking target system type... h8300-hitachi-hms checking build system type... i686-pc-cygwin cc: not found *** The command 'cc -o conftest -g conftest.c' failed. *** You must set the environment variable CC to a working compiler.

  • fodora10でのソフトウェアのインストール

    linux初心者です。 タイトルの通り、現在使用しているfedora10で、ソフトウェアのインストールができず、困っています。 具体的に言うと、xxx.tar.gzのようなものをインストールしようとすると、./configureのところで #./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for gawk... gawk checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking for ranlib... ranlib checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking how to run the C++ preprocessor... g++ -E checking for wx-config... no configure: error: Please check that wx-config is in path, the directory where wxWindows libraries are installed (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH or equivalent variable and wxWindows is version 2.6.0 or above. のようになり、その後makeをすると # make make: *** ターゲットが指定されておらず, makefile も見つかりません. 中止. となってしまいます。./configure でエラーが出ている様なのですが、よく分かりません。 どなたか知っていましたら解決法を教えていただければありがたいです。お願いします。

  • redhat9でxineをインストールしようとして・・・

    redhat9でxineをインストールしようとしています。 xine-lib-1.0で「./configure」を実行すると、下記のエラーがでます。 checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking for gcc... no checking for cc... no checking for cc... no checking for cl... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. gccがインストールされていないのかなと思い、「rpm -qa | grep gcc」とすると、 compat-gcc-7.3-2.96.118 libgcc-3.2.2-5 compat-gcc-c++-7.3-2.96.118 とでますので、パスが通ってないと思うのですが、違うのでしょうか?それともインストールされてないのでしょうか?ちなみに「echo $PATH」とすると /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/lib と出ます。

  • PHPのインストールがうまくできない。

    環境Fedora2 [root@localhost php-5.2.1]# ./configure --with-pgsql --with-apxs2=/usr/local/apache/bin/apxs --enable-mbstring --enable-mbregex ~省略~ checking if compiler supports -Wl,-rpath,... yes checking for re2c... re2c checking for re2c version... 0.11.0 (ok) checking for gawk... gawk checking for bison... no checking for byacc... no checking for bison version... invalid configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 (found: none). checking for flex... lex checking for yywrap in -ll... no checking lex output file root... ./configure: line 3375: lex: command not found configure: error: cannot find output from lex; giving up warning だと、PHP parsersのためのバージョンが必要ということでしょうか?当然makeもできません。 [root@localhost php-5.2.1]# make make: *** ターゲットが指定されておらず、makefile も見つかりません。中止。 調べたんですが aptの導入が必要のようですがよくわからないので詳しい方おねがいします。

  • VineLinux3.2でのMRTG(こちらで回答ねがいます)

    こんばんわ MRTGを導入しようと思ってダウンロード→tar.gz解凍→./configureを打ったら以下のエラーメッセージが出てきます。 [root@localhost mrtg-2.12.2]# ./configure checking for gcc... no checking for cc... no checking for cc... no checking for cl... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. このときはどうすればよいのでしょうか。 尚参考ページとして、http://vine.1-max.net/net-snmp+MRTG.htmlを見てやりました。

  • Apacheのバージョンアップでエラー

    既存Apache2.2.15から2.2.22へマイナーバージョンアップをやってみたのですが、 途中でエラーが表示されてしまいました。 すみません。エラーの理由が分かれば教えていただけないでしょうか。 OSはCentOS6です。 #cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bk(バックアップ) #/usr/bin/apachectl stop #tar zxvf ./httpd-2.2.22.tar.gz (ダウンロードしたものを展開) #cd httpd-2.2.22 #./configure --prefix=/etc/httpd #./configureまで来て、以下のエラーが表示されました。 又、makeをしようとしても当然configureの設定が終了していないので エラーになっていると思われます。 checking for chosen layout... Apache checking for working mkdir -p... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu Configuring Apache Portable Runtime library ... checking for APR... reconfig configuring package in srclib/apr now checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu Configuring APR library Platform: i686-pc-linux-gnu checking for working mkdir -p... yes APR Version: 1.4.5 checking for chosen layout... apr checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/httpd-2.2.22/srclib/apr': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. configure failed for srclib/apr [root@web01 httpd-2.2.22]# make make: *** ターゲットが指定されておらず, makefile も見つかりません. 中止. あともう1点教えていただきたいです。 アップグレードが途中で失敗している状態なのですが、configureまでであれば、既存のApacheには 影響していないでしょうか?

  • MySQLのコンパイル

    MySQL-5.0.16をインストールし、下記のようにconfigureを実行したところ、「C compiler が見つからない」旨のメッセージが出て先へ進めません。 yum で gcc や cc のインストールを試みてもうまくいきません。 どなたか、良いアドバイスをお願いします。 OSはFedoraCore4の英語バージョンです。 [root@Linux mysql-5.0.16]# ./configure --prefix=/usr/local/mysql --with-charset=ujis --with-extra-charset=all ------------------------------------------------- checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking "character sets"... default: ujis, collation: ujis_japanese_ci; compiled in: ujis latin1 utf8 checking whether to compile national Unicode collations... yes checking whether build environment is sane... yes checking whether make sets $(MAKE)... (cached) yes checking for gawk... (cached) gawk checking for gcc... no checking for cc... no checking for cc... no checking for cl... no configure: error: no acceptable C compiler found in $PATH See `config.log' for more details. ----------------------------------------------------

専門家に質問してみよう