h@Hrvojes-MacBook-Pro problemSet2 % ./hours
dyld[18659]: Library not loaded: libcs50-11.0.2.dylib
Referenced from: <099E85B4-69E7-3DB9-BBCB-261540A924DC> /Users/h/CS50 Learning/2.ARRAYS/problemSet2/hours
Reason: tried: 'libcs50-11.0.2.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibcs50-11.0.2.dylib' (no such file), 'libcs50-11.0.2.dylib' (no such file), '/Users/h/CS50 Learning/2.ARRAYS/problemSet2/libcs50-11.0.2.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/h/CS50 Learning/2.ARRAYS/problemSet2/libcs50-11.0.2.dylib' (no such file), '/Users/h/CS50 Learning/2.ARRAYS/problemSet2/libcs50-11.0.2.dylib' (no such file)
zsh: abort ./hours
I tried running a simple program I wrote and it's not compiling.
You need to install, and/or locate, the dynamic library it is looking for: libcs50
The instructions for installing on mac OS are (copied from README.md):
From Source (Linux and Mac)
libcs50-*.*cd libcs50-*sudo make installBy default, we install to
/usr/local. If you'd like to change the installation location, runsudo DESTDIR=/path/to/install make installas desired.Afterwards, recompile your program (link with
-lcs50).If you are still having trouble, ensure you are looking for the dynamic libraries in the correct place by using the
LD_LIBRARY_PATHenvironment variable.With the default install from above, execute your program as:
(If you installed with a different path, i.e., you used
DESTDIRabove, then specify that path forLD_LIBRARY_PATH.)