cs50/libcs50

Error for M1 mac

aadhil-aslam opened this issue ยท 3 comments

Undefined symbols for architecture arm64:
"_get_int", referenced from:
_main in scores-c9119a.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

What command did you run to compile your C program?

Besure to link CS50 C library when compiling your program:

clang example.c -lcs50 -o example

clang example.c -lcs50 -o example

I ran into this same error and this was my issue. Thank you! ๐ŸŽ‰