0
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 3 years have passed since last update.

./cryptlib.h:62:11: fatal error: 'stdlib.h' file not found

Last updated at Posted at 2021-03-15

症状

rbenv installopensslのインストールのときに引っかかるだけかもしれないけど。

$ rbenv install 2.3.4
Downloading openssl-1.0.2u.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16
Installing openssl-1.0.2u...

BUILD FAILED (OS X 10.15.6 using ruby-build 20200224)

Inspect or clean up the working tree at /var/folders/m6/cq5lzgy56_j2bs6x0665h7dh0000gp/T/ruby-build.20210315152950.75743.aGLcgu
Results logged to /var/folders/m6/cq5lzgy56_j2bs6x0665h7dh0000gp/T/ruby-build.20210315152950.75743.log

Last 10 log lines:
/usr/bin/perl ../util/mkbuildinf.pl "clang -I. -I.. -I../include  -fPIC -fno-common -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM" "darwin64-x86_64-cc" >buildinf.h
clang -I. -I.. -I../include  -fPIC -fno-common -DOPENSSL_PIC -DZLIB_SHARED -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -I/Users/hogeuser/.rbenv/versions/2.3.4/include   -c -o cryptlib.o cryptlib.c
In file included from cryptlib.c:117:
./cryptlib.h:62:11: fatal error: 'stdlib.h' file not found
# include <stdlib.h>
          ^~~~~~~~~~
1 error generated.
make[1]: *** [<builtin>: cryptlib.o] Error 1
make[1]: Leaving directory '/private/var/folders/m6/cq5lzgy56_j2bs6x0665h7dh0000gp/T/ruby-build.20210315152950.75743.aGLcgu/openssl-1.0.2u/crypto'
make: *** [Makefile:287: build_crypto] Error 1

調査

Cわからないから本格的な情報調査というより、ネットで同様の事例が起きた人を探した
xcode-select --install
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)

上記を試した結果

自分の場合はexport SDKROOT=$(xcrun --sdk macosx --show-sdk-pathでうまくいきました!

前もこの事例あったから、将来の自分のために。

(多分Avira antivirusユーザ限定)rbenvに限った話で言えば、以下も発生したから、↑をやったときにもしかしたらこれも起きるかも
アンチウイルスソフトの影響で ruby のインストールに失敗した

0
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
0
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?