# CMake Error: Feature cxx_std_17 is not available for compiler "GNU" version 4.8.

- **ID:** `cmake/compiler-feature-request-failed`
- **Domain:** cmake
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

A target or project requests a C++ standard feature (e.g., cxx_std_17) that the installed compiler does not support due to its old version.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| GCC 4.8 | active | — | — |
| GCC 5.4 | active | — | — |
| Clang 3.5 | active | — | — |

## Workarounds

1. **Upgrade the compiler to a version that supports C++17 (e.g., GCC 7 or later). Alternatively, set the target to a lower standard: set_target_properties(mytarget PROPERTIES CXX_STANDARD 14).** (95% success)
   ```
   Upgrade the compiler to a version that supports C++17 (e.g., GCC 7 or later). Alternatively, set the target to a lower standard: set_target_properties(mytarget PROPERTIES CXX_STANDARD 14).
   ```
2. **Use target_compile_features(mytarget PRIVATE cxx_std_14) instead of cxx_std_17, and adjust code accordingly. Example: target_compile_features(mytarget PRIVATE cxx_std_14).** (90% success)
   ```
   Use target_compile_features(mytarget PRIVATE cxx_std_14) instead of cxx_std_17, and adjust code accordingly. Example: target_compile_features(mytarget PRIVATE cxx_std_14).
   ```
3. **If compiler upgrade is not possible, use a compatibility layer or conditionally compile C++17 features: if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) target_compile_features(mytarget PRIVATE cxx_std_17) endif().** (85% success)
   ```
   If compiler upgrade is not possible, use a compatibility layer or conditionally compile C++17 features: if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) target_compile_features(mytarget PRIVATE cxx_std_17) endif().
   ```

## Dead Ends

- **** — The compiler still does not support C++17; code using C++17 features will fail to compile with cryptic errors. (80% fail)
- **** — CMake will still detect the compiler version and may produce warnings; also, compiler may not fully support C++17. (75% fail)
