Warmachine Libft

0 views
Skip to first unread message

Harald Atta

unread,
Aug 5, 2024, 1:30:08 AM8/5/24
to niodisandre
Everythingseems to compile just fine until I try to use the libftprintf.a file with the make test command. I've searched for a solution on Google, but most answers relate to XCode only. According to lipo -info, the files are x86_64.

I've found a slightly dirty but working solution for now. I extract the libft/libft.a archive in a temporary directory. Link the new library with the extracted .o files and then remove the temporary directory.


If you have fat architecture object files you must make sure that you pass the s flag to ar. Without it the linker will refuse to take archive files that contain fat architecture .o files. For example:


You should then see a warning about creating a 'fat archive'. Don't worry about this, it means that ar won't be able to update the archive file, but the linker will be able to use it to link properly.


Run make f or ./run_test when inside the repo's directory. ./run_test -b to use the Benchmark mode. (-b option to compare with system's libc and -v option to compare with another libft file (should be libft.so).

3a8082e126
Reply all
Reply to author
Forward
0 new messages