libcs50 icon indicating copy to clipboard operation
libcs50 copied to clipboard

Error for M1 mac

Open aadhil-aslam opened this issue 3 years ago • 2 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)

aadhil-aslam avatar Aug 24 '22 09:08 aadhil-aslam

What command did you run to compile your C program?

rongxin-liu avatar Aug 24 '22 19:08 rongxin-liu

Besure to link CS50 C library when compiling your program:

clang example.c -lcs50 -o example

rongxin-liu avatar Aug 24 '22 19:08 rongxin-liu

clang example.c -lcs50 -o example

I ran into this same error and this was my issue. Thank you! 🎉

Thenlie avatar Sep 09 '22 03:09 Thenlie