#clang14 compiler error?

12 messages · Page 1 of 1 (latest)

queen forum
#

Everything you need to see is below. In short, it’s failing to compile because of the experimental-library flag that I need for std::format. Not sure where to go from here

root@a953f4529af5:/workspace/rawterm# cmake -S . -B build/ && cmake --build build/
-- The CXX compiler identification is Clang 14.0.6
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /workspace/rawterm/build
[  5%] Building CXX object rawterm/CMakeFiles/rawterm.dir/color.cpp.o
clang: error: unknown argument: '-fexperimental-library'
gmake[2]: *** [rawterm/CMakeFiles/rawterm.dir/build.make:76: rawterm/CMakeFiles/rawterm.dir/color.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:128: rawterm/CMakeFiles/rawterm.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
root@a953f4529af5:/workspace/rawterm# clang --version
Debian clang version 14.0.6
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
root@a953f4529af5:/workspace/rawterm# cat CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
project(rawterm LANGUAGES CXX)

add_subdirectory(rawterm)

if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)

    add_compile_options("-g")
    add_compile_options("-Wall")
    add_compile_options("-Werror")
    # add_compile_options("-fsanitize=address")

    set(CMAKE_CXX_STANDARD 20)
    set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

    add_subdirectory(examples)
endif()
root@a953f4529af5:/workspace/rawterm# cat rawterm/CMakeLists.txt
set(CMAKE_CXX_STANDARD 20)

add_library(rawterm STATIC
    color.cpp
    core.cpp
    cursor.cpp
    text.cpp

    extras/extras.cpp
)

target_include_directories(rawterm PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
target_compile_options(rawterm PRIVATE -fexperimental-library)
``'
ivory leafBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

raw elbow
#

That's some old Clang. Are you forced to use it?

outer thorn
#
  • for above. Maybe this version doesn't support the flag yet?
queen forum
#

It’s the version in Debian stable. I could upgrade but i dont want to go through the hassle just for a docker container. 😂

outer thorn
#

this CLang version is almost 2 years old.

outer thorn
#

The packages are always so behind

queen forum
raw elbow
#

It's a bit weird to want to use the latest features, but at the same time try to use them on an old compiler

queen forum
#

Fair enough