|
Common System 0.2.0
Common interfaces and patterns for system integration
|
Cause**: Your compiler is below the C++20 baseline required by common_system. std::format arrived in GCC 13, Clang 17, and MSVC 2022 — earlier versions will reject the headers.
Fix**: Upgrade the compiler, or on Linux install libstdc++-13-dev alongside GCC 13.
Cause**: The <concepts> header isn't being found, or -std=c++20 isn't being passed to the compiler.
Fix**: In CMake, ensure CMAKE_CXX_STANDARD is set before the project declaration:
Cause**: CMake can't locate the installed package. Either it isn't installed, or CMAKE_PREFIX_PATH doesn't include the install location.
Fix**: Either install common_system to a system location (cmake --install build), or point your build at the install tree:
For development, prefer FetchContent or add_subdirectory to pull common_system directly into your build.
Cause**: vcpkg's registry doesn't know about common_system — you need to register the overlay.
Fix**: Add the overlay to vcpkg-configuration.json:
Cause**: The application is including the headers but not linking the library target. Some patterns (event bus, circuit breaker) have out-of-line definitions.
Fix**: In your CMakeLists.txt:
Do NOT just add the include path — the linker needs the target.
Cause**: You're trying to resolve a service that nothing ever registered. Common causes: initialization order, register-after-resolve, or the wrong interface type.
Fix**: Ensure registration happens during startup, before the first resolve. Log or break at the registration point to confirm it actually runs:
Cause**: You called .value() on a Result that carries an error. The error details are in .error(), not .value().
Fix**: Check .is_ok() first, or use .value_or(default). See Tutorial: Result<T> Error Handling for the idiomatic pattern.