Shared Memory Library -lrt in C on macOS

孤街浪徒 提交于 2019-12-08 08:02:00

问题


I'm doing a university assignment on shared memory on C, I need to use the functions shm_open(), mmap(), ftruncate(), shm_unlink(), etc. using a Mac with macOS Mojave 10.14 My teacher told me I need to use the -lrt library in my Makefile to make it work but when I "make" I got an error which goes

ld: library not found for -lrt
clang: error: linker command failed with exit code 1

Is the library spelled work? If I don't have it, I need to download it? Do I even need a specific library? ('cause on the internet I didn't find anybody using one...) I'm very confused.

来源:https://stackoverflow.com/questions/53595529/shared-memory-library-lrt-in-c-on-macos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!