gcc ビルドエラー

gcc ビルドエラー

gccを設定するとエラーメッセージが表示されます。誰でも助けることができますか?してください..

messages..
checking whether the C compiler works... no
configure: error: in `/home/kjs0625/gcc/gcc-13.1.0':
configure: error: C compiler cannot create executables

config.log
gcc (GCC) 13.1.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4407: $? = 0
configure:4396: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/13.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/root --with-mpc=/root --with-mpfr=/root --with-gmp=/root --with-isl=/root --enable-languages=c,c++ --disable-multilib --with-static-standard-libraries
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.0 (GCC)
configure:4407: $? = 0
configure:4396: gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4407: $? = 1
configure:4396: gcc -qversion >&5
gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:4407: $? = 1
configure:4427: checking whether the C compiler works
configure:4449: gcc    conftest.c  >&5
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
configure:4453: $? = 1
configure:4491: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4496: error: in `/home/kjs0625/gcc/gcc-13.1.0':
configure:4498: error: C compiler cannot create executables
See `config.log' for more details

..誰か助けてくださいTT

ベストアンサー1

checking whether the C compiler works... no
configure: error: in `/home/kjs0625/gcc/gcc-13.1.0':
configure: error: C compiler cannot create executables

まず解決すべき部分です。現在、Cコンパイラが実行可能ファイルを生成できない場合は、利用可能なgccコンパイラを生成できません。

Cコンパイラが実行可能ファイルを生成できるかどうかをテストするには、単純な「Hello、world」プログラムを使用するか、コードを使用できますconfigure。一部のライブラリが欠落している可能性があります。

/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s

おすすめ記事