usatie / libft-tester-tokyo

Tester for the libft project of 42 school
24 stars 3 forks source link

ubuntuで#<malloc/malloc.h>がないために、このエラーが出ます #5

Open yuki-shimoda-crypto opened 2 years ago

yuki-shimoda-crypto commented 2 years ago

make -C libft-tester-tokyo make[1]: Entering directory '/home/ubuntu/Desktop/42tokyo/42cursus/libft/ft/libft-tester-tokyo' make -C ../ make[2]: Entering directory '/home/ubuntu/Desktop/42tokyo/42cursus/libft/ft' make[2]: Nothing to be done for 'all'. make[2]: Leaving directory '/home/ubuntu/Desktop/42tokyo/42cursus/libft/ft' make -C ./libs/libassert make[2]: Entering directory '/home/ubuntu/Desktop/42tokyo/42cursus/libft/ft/libft-tester-tokyo/libs/libassert' cc -c libassert.c -o objs/libassert.o -Wall -Werror -Wextra libassert.c:17:10: fatal error: 'malloc/malloc.h' file not found

include <malloc/malloc.h>

     ^~~~~~~~~~~~~~~~~

1 error generated. make[2]: [Makefile:27: objs/libassert.o] Error 1 make[2]: Leaving directory '/home/ubuntu/Desktop/42tokyo/42cursus/libft/ft/libft-tester-tokyo/libs/libassert' make[1]: [Makefile:103: start_tests] Error 2 make[1]: Leaving directory '/home/ubuntu/Desktop/42tokyo/42cursus/libft/ft/libft-tester-tokyo' make: *** [Makefile:77: test] Error 2

TetsuOtter commented 1 year ago

(cc: @usatie) このテスターはmacOSでしか動作しないため、Ubuntu (Linux) 環境でエラーが出てしまうのは仕方がない面があるかなと思います。

Linux対応を入れようとすると、libassert.cについては少なくとも

が必要になりますし、 テスターの構造が「本物の関数を呼び出してその結果の差を確認する」形である都合上、glibcに含まれないstrlcpystrlcatのテストが不可能になる (コンパイルエラーを吐く) ことになりますし。 (glibcにない関数については「コンパイル + テストを行わない」ということも可能ですが、ユーザへの周知が大変そうで…)

確かにLinux需要は大きそうですし、個人的にも欲しい機能ではありますが…