-
Notifications
You must be signed in to change notification settings - Fork 856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac M1: Undefined symbols for architecture arm64 when trying to use cs50.h #334
Comments
I think the issues on M1 Macs may not stem from the system installation of Clang, since I have now tried the following:
...and, for good measure (and as a last resort), I tried compiling with
Edit:
...but also Homebrew's
Running
...which I find a bit spooky and confusing, because I do have the
|
This worked to at least get me unstuck when following the course videos. No luck with clang no matter what I try, but a brew-installed |
@zizlog @HoonyHoney-91: as follow-up to:
I don't think it solves the issue.
Although it works using your suggestion, it fails using make, giving the error @HoonyHoney-91 points out. I'm having the same issue as him.
Originally posted by @zizlog in #212 (comment)
On my Mac M1 I got a similar error message:
The mention of clang made me suspicious, as I was under the impression that gcc was being used. When running gcc indeed a reference to clang comes up:
Digging a bit led me to https://stackoverflow.com/questions/64992467/mac-clang-installation-seems-to-override-gcc-install. The comments in there made me check the version of make I was using:
That seemed pretty ancient, checking the versions on https://ftp.gnu.org/gnu/make/. After running "brew install make", I now got:
Seeing this caveat made me run "export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"":
Now, when running "make hello" it works, without having to add anything special to link cs50 as make now invokes gcc with the right parameters, just like when using a Makefile:
The text was updated successfully, but these errors were encountered: