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
macOS-latest's C++ environment seems incomplete: -stdlib=libc++ being ignored #658
Comments
Your problem is here. Why are you trying to link against Also see this stackoverflow answer. Side note: You might want to use |
@Geod24, I'm not linking against libstdc++, but against libc++. Check the link mentioned by yourself (in a earlier commit, though, I attempted passing libstdc++ for investigation purposes). In fact, I only added explicit link information because, with the default settings, I was already getting the error. Thanks for the hint about CXX_STANDARD, I'll give it a try. |
My bad, I got things quite mixed up. I have a project where I build C++ code using C++14 and the native toolchain, and things are working just fine, so I am pretty sure that the Github environment is fine. However said project is using its own build system, so I can't provide an example with CMake. Can you provide the command where clang is invoked? |
I've tried CXX_STANDARD but the issue remains. From a bit more googling, this seems to be libc++ regression -- that might reproduce for certain #include ordering. (I'm actually developing on OSX myself.) |
Hello @ltcmelo ,
To switch to Clang 10, we need to use the following steps:
Please pay attention that Unfortunately, I am not super familiar with Clang / g++ so I can't explain the root cause why Clang 11 doesn't work as expected but hope the steps above will help you |
Thanks @maxim-lobanov , I'll give it a try. |
Hello @ltcmelo , did it work for you ? |
Hi @dmitry-shibanov , just gave it a try and it worked. FYI, this is how the workflow looks now. Thanks again 👍 |
Hello @ltcmelo , thank you for your response. I closed the issue but if you have any concerns feel free to reopen the issue. |
In case anyone runs into this problem... Once I've updated my system (and reproduced the issue locally), tracked the root cause of the problem. There's apparently been a change in the search paths behavior libc++: now, either it respects paths passed through |
Describe the bug
It appears to me that the C++ environment for macOS-latest (with the clang compiler) is incomplete. Specifically, it doesn't seem to be possible to build against a C++11 (or later) standard library implementation, e.g., libstdc++ or libc++. An official description of the role of libc++ in osx is available here -- there's also plenty of discussion around online.
Area for Triage:
Question, Bug, or Feature?:
A bug.
Virtual environments affected
Expected behavior
See a successful compilation on ubuntu-latest.
Actual behavior
See this compilation error on macOS-latest.
The text was updated successfully, but these errors were encountered: