Skip to content

error: ‘runtime_error’ is not a member of ‘std’ #153

@rpaasche

Description

@rpaasche

Defining C4_EXCEPTIONS_ENABLED and C4_ERROR_THROWS_EXCEPTION causes the error (with c++17):

c4core/src/c4/error.cpp:115:20: error: ‘runtime_error’ is not a member of ‘std’
  115 |         throw std::runtime_error(buf);
      |   

To fix this we have to add #include <stdexcept> to error.cpp:31+

#if defined(C4_EXCEPTIONS_ENABLED) && defined(C4_ERROR_THROWS_EXCEPTION)
#   include <exception>
+ #   include <stdexcept>
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions