Skip to content
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

cross-compilations to mac failed because clang not found #142

Open
sech1p opened this issue Nov 23, 2023 · 3 comments
Open

cross-compilations to mac failed because clang not found #142

sech1p opened this issue Nov 23, 2023 · 3 comments

Comments

@sech1p
Copy link

sech1p commented Nov 23, 2023

Hello, i could not compile my program to mac because (as above): cgo: C compiler "clang" not found: exec: "clang": executable file not found in $PATH

Can this somehow be resolved? Thank you for any help and best regards

https://github.com/sech1p/AppleMusic_Discord_RPC/actions/runs/6959620053/job/18937261755

@wangyoucao577
Copy link
Owner

It seems that your code requires clang for cgo features, but this action doesn't have clang installed at the moment. Could you please try out to install clang use something like pre_command: apt update && apt install clang, alternatively you can have a try to switch C compiler to gcc by env: CC=gcc?

@sech1p
Copy link
Author

sech1p commented Nov 25, 2023

Thanks it works! But in result i got an weird error like clang: error: argument unused during compilation: '-arch x86_64' [-Werror,-Wunused-command-line-argument] and no ideas how to fix it

@wangyoucao577
Copy link
Owner

Actually it's cross compilation that runs on x86_64 but target to mac arm. Do you know which libs you're cross compiling on? I.e., that you enables CGO for. You may need to follow its instructions for some settings. This example may helpful for reference: https://stackoverflow.com/questions/69643927/cross-compiling-for-linux-arm-7-clang-error-argument-unused-during-compilation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants