4
1

More than 1 year has passed since last update.

Rubyインストールでimplicitly declaring library function 'memcmp' with type

Last updated at Posted at 2022-07-12

事象

  • rbenvを使って、ruby
$rbenv install 3.1.2
Downloading openssl-1.1.1q.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca
Installing openssl-1.1.1q...

BUILD FAILED (macOS 12.4 using ruby-build 20220710)

Inspect or clean up the working tree at /var/folders/tr/lpqk0__92s3bds2hlb500cf40000gn/T/ruby-build.20220712172414.90364.qfB2fT
Results logged to /var/folders/tr/lpqk0__92s3bds2hlb500cf40000gn/T/ruby-build.20220712172414.90364.log

Last 10 log lines:
clang  -Iinclude -arch x86_64 -O3 -Wall -D_REENTRANT -DZLIB -DZLIB_SHARED -DNDEBUG -I/Users/shinjikawaguchi/.rbenv/versions/3.1.2/include  -MMD -MF test/verify_extra_test.d.tmp -MT test/verify_extra_test.o -c -o test/verify_extra_test.o test/verify_extra_test.c
clang  -Iinclude -arch x86_64 -O3 -Wall -D_REENTRANT -DZLIB -DZLIB_SHARED -DNDEBUG -I/Users/shinjikawaguchi/.rbenv/versions/3.1.2/include  -MMD -MF test/versions.d.tmp -MT test/versions.o -c -o test/versions.o test/versions.c
test/v3ext.c:201:24: error: implicitly declaring library function 'memcmp' with type 'int (const void *, const void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
        if (!TEST_true(memcmp(ip1->data, ip2->data, ip1->length) <= 0))
                       ^
test/v3ext.c:201:24: note: include the header <string.h> or explicitly provide a declaration for 'memcmp'
1 error generated.
make[1]: *** [test/v3ext.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

原因と対応

  • opensslのインストールに失敗していましたので、以下を環境変数を設定したらインストールできました。
OPENSSL_CFLAGS=-Wno-error=implicit-function-declaration rbenv install 3.1.2

参考

4
1
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
4
1