Closed meliodaseren closed 5 years ago
@meliodaseren try this command
gcc -lcs50-9.0.0 hello.c
I had the same error as @meliodaseren and @intrueder's suggestion worked.
It looks like the libcs50.dylib symlink is incorrectly pointing to libcs50-9.dylib for some reason, which I was able to fix by running:
sudo ln -sf libcs50-9.0.0.dylib /usr/local/lib/libcs50.dylib
Hi @intrueder @mattangriffel,
it's work, I also modify the symlink of libcs50.dylib
, I appreciate your help.
@meliodaseren try this command
gcc -lcs50-9.0.0 hello.c
THAT was brilliant. Got me up and going again. Man i missed you guys. Hope i can finish this course this time. Wish me luck. Blessings! (i actually used -lcs50-9.0.1, in case anyone was wondering)
error - cc hello2.c -o hello2 Undefined symbols for architecture arm64: "_get_string", referenced from: _main in hello2-1413d6.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [hello2] Error 1
error - cc hello2.c -o hello2 Undefined symbols for architecture arm64: "_get_string", referenced from: _main in hello2-1413d6.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [hello2] Error 1
Besure to link CS50 C library when compiling your program:
clang example.c -lcs50 -o example
Thank you, this three part youtube video is also very helpful https://krishanthecoder.io/installing-cs50-library-locally-on-macos/
lenntil/cs50-minimal-setup: CS50 Minimal Setup for macOS and Linux
I wrote this to help you guys.
Local machine: macOS Mojave 10.14.3
After the installation (v9.0.0) is complete, I execute the following command for compiling:
gcc -lcs50 hello.c
But the log shows the following error:
I have checked
/usr/local
and there do have the following files after installation:/usr/local/lib/libcs50-9.0.0.dylib
/usr/local/lib/libcs50.dylib
/usr/local/include/cs50.h
What can I do to check this issue ?