cs50 / libcs50

This is CS50's Library for C.
https://cs50.readthedocs.io/libraries/cs50/c/
GNU General Public License v3.0
1.79k stars 861 forks source link

Compile C File throw error "ld: symbol(s) not found for architecture x86_64" #260

Closed minhanphanle closed 2 years ago

minhanphanle commented 2 years ago

Install the CS50 library following the instructions for macOS https://cs50.readthedocs.io/libraries/cs50/c/. Stuck on this error for years. I'm a newbie so I don't know how to solve this issue. Please support :<

ld: warning: ignoring file /usr/local/lib/libcs50.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_get_int", referenced from:
      _main in calculator0-bbacca.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

macOS hardware details:

image
rongxin-liu commented 2 years ago

Please email sysadmins@cs50.harvard.edu with the C file you are trying to compile. Thanks!