-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Clang cannot find C++ header files on 24.04 #11229
Comments
Hi @K20shores , Thank you for bringing this issue to our attention. We are looking into this issue and will update you on this issue after investigating. |
Hi @K20shores - As per reproduction steps we created a minimal CPP project and executed the workflow , but the workflow passed as expected. Let us know if missing something. |
@subir0071 Your action uses the GCC compiler. Please use the clang compiler. I updated my reproduction steps to represent this. Sorry for the confusion. I see this issue with the clang compiler. |
I updated my workflow to select clang compiler. |
Oh I can fix this one real quickly for you guys, give me one second. I need to go on a lunch break. |
"Hey team, I think I can fix this real quick! Here's what I'll do after lunch: Verify Clang's include paths on Ubuntu 24.04. Step-by-Step Fix
Check Clang's version: bash bash Install libc++ and libc++abi: bash Check /usr/include/c++/ or /usr/include/clang/ directories to ensure they exist. Export CPLUS_INCLUDE_PATH and LIBRARY_PATH: bash bash yaml on: jobs:
cpp bash "Hey team, I’ve resolved the Clang header issue on Ubuntu 24.04. Here’s what I did: Installed the required libraries (libc++ and libc++abi) using: bash Updated the CPLUS_INCLUDE_PATH if necessary: bash Install dependencies. With these steps, you’ll provide a bulletproof fix and ensure everyone can run Clang workflows smoothly on Ubuntu 24.04. Let me know if you need anything else! So I am very profficent in C, I have translated this down C programming into Assembly Language. What's also going on is probably not updating your stubs, your header files, and also updating your MAKEFILE/Receipe for your build. C, even C++ is brtual you do not update every single detail and component, that's why Clang is not finding C++ headers. You might need make sure they are explicity stated like this. Header.h and then you have to link them during compilation as a modular component of whatever clang system you're building. |
you are also probably not mounting the Ubuntu either to a docker/clang protocol either. That has to be done manually before it automates via either clang or docker mount imaging with Ubuntu. |
Root Causes bash bash makefile bash yaml I miss my own dependencies ALL the time, C is bad with that sort of ish, and I'm hoping I'm at least helping a little bit in some way by providing some of this documentation debugging for you in Clang/docker. Root Causes
bash bash makefile bash yaml on: jobs:
Additional Notes FYI, Header.c header.h are just... well, examples, placeholders to help you conceptualize what's going on with your runtime compilation errors. YOU CAN also merely just STUB the header file, but it's not going to define any specific variable function within your C program protocol, and you will have to explicility define those variable objects into the .c file themselves, as a warning and aside. Okay... Hope that helps you! signing off. |
Description
Following the update of
ubuntu-latest
updating to Ubuntu 24.04, Ubuntu workflows with clang started failing to build. It seems that Clang cannot find the header files for much of the C++ standard library.Anything failing on 20.04 is a non issue because we weren't really targeting that. However, clang on 24.04 does not seem to find the C++ header files.
Platforms affected
Runner images affected
Image version and build link
I put together an action which builds our software with gcc/clang in debug/release on 20.04, 22.04, 24.04, and latest so I can see where we are failing. The action.
Is it regression?
Yes
Expected behavior
Clang finds c++ header files
Actual behavior
Clang doesn't find c++ header files
Repro steps
Create a project which uses C++ on Ubuntu 24.04 and try to compile it with clang
The text was updated successfully, but these errors were encountered: