1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

configureスクリプトでMakefile作成時に発生する「checking whether the C compiler works... no」の直し方

Last updated at Posted at 2023-08-11

発生した現象

configureスクリプトでMakefile作成時に以下のエラーが発生した。

$ ../ruby/configure --prefix=$PWD/../install --enable-shared

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.71.  Invocation command line was

  $ ../ruby/configure --prefix=/Users/daiki-kudo/repos/ruby/build/../install --enable-shared


...(中略)...


## ----------- ##
## Core tests. ##
## ----------- ##

configure:6061: checking whether the C compiler works
configure:6083: clang  -I/usr/local/opt/llvm/include -L/usr/local/opt/llvm/lib conftest.c  >&5
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
configure:6087: $? = 1
configure:6127: 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 ""
| #define RUBY_ABI_VERSION 0
| /* end confdefs.h.  */
| 
| int
| main (void)
| {
| 
|   ;
|   return 0;
| }
configure:6132: error: in `/Users/daiki-kudo/repos/ruby/build':
configure:6134: error: C compiler cannot create executables
See `config.log' for more details

解決方法

以下の二つを行い、Anaconda関連のコードを削除すると直った。(ref)

  • ~/.zshrc内のconda関係の設定を削除。
  • $ rm -rf ~/anaconda3でAnaconda関係のディレクトリを削除。

他にやったこと

自分の場合以下では直らなかった。(ref)

brew upgrade llvm
brew upgrade gcc
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

ref.

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?