setup-clang
setup-clang copied to clipboard
clang missing the libc++
hello, I using clang to compile my code, compile with libc++:
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
endif()
it works in my localhost, but does not work in github action(it loses a lot of system headers, https://github.com/netcan/config-loader/runs/4703563002?check_suite_focus=true). When I remove the CMake code above, It works in github action but compiles failed in my localhost(I have checked it must compile with clang system headers, using libc++).
so how to keep the same CMake in localhost and github action? https://github.com/netcan/config-loader/blob/c%2B%2B20/CMakeLists.txt#L12
Could it be that libc++ is not installed on GitHub Actions runners? Can you try installing the libc++-dev
package (sudo apt install -y libc++-dev
) and see if the problem persists?
sudo apt install -y libc++-dev
I tried to install libc++-13-dev, libc++-dev is installed and I use clang13 version. but it installs failed.
sudo apt-get install -y libc++-13-dev
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libc++-13-dev : Depends: libc++1-13 (= 1:13.0.1~++20211223012851+9468a0f95385-1~exp1~20211223012902.41) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
https://github.com/netcan/config-loader/runs/4714090393?check_suite_focus=true
I'm hitting the same issue with Ubuntu images on github.