-
Notifications
You must be signed in to change notification settings - Fork 13.4k
std::expected link error #132945
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
Comments
#87390 seems related. |
Not sure it helps, but
|
The problem is that you're using a libc++ dylib which is older than the headers. You need to either make sure that you're loading the correct (homebrew-provided) dylib, or have availability annotations enabled that match AppleClangs. Fundamentally this is a homebrew issue though, since they're not automagically loading the correct dylib. Please ask them for further support/guidance. I'm quite certain this isn't the first issue I've seen related to this. If they need help properly distributing Clang and libc++ they are free to ask. |
I just ran into this issue. As @philnik777 said, it seems that it was picking up another libc++. if(APPLE)
target_link_options(expected_test PRIVATE
-L/opt/homebrew/opt/llvm/lib/c++ # TODO: non-hardcoded path
)
endif() fixes the issue. |
I agree with @philnik777 here, I think this is a Homebrew issue. If you want to file an issue against Homebrew, feel free to ping me on it and I can help them to figure out the right way to distribute on Apple platforms. |
Thanks @ldionne and @GuillaumeQuenneville. It is indeed a configuration issue. For future reference the issue is addressed here https://github.com/orgs/Homebrew/discussions/5849 |
Compiling the following example
with
I get the following error
some more info
Compiling with
clang
version 18 gives no error.Not sure what is the issue. Hope someone can help.
The text was updated successfully, but these errors were encountered: