Skip to content

Compilation error in MacOS: no member named 'terminate' in namespace 'std'; did you mean 'template'? #287

Open

Description

@amwink

I'm installing XTL on MacOS, building the tests as well. During this build I get the error:

In file included from /Users/amwink/software/cpp/bispackage/dep/xtensor-stack/xtl/test/test_xhalf_float.cpp:17:
In file included from /Users/amwink/software/cpp/bispackage/dep/xtensor-stack/xtl/include/xtl/xhalf_float.hpp:14:
/Users/amwink/software/cpp/bispackage/dep/xtensor-stack/xtl/include/xtl/xhalf_float_impl.hpp:4022:8: error: no member named 'terminate' in namespace 'std'; did you mean 'template'?
 4022 |                 std::terminate();
      |                 ~~~~~^~~~~~~~~
      |                      template
/Users/amwink/software/cpp/bispackage/dep/xtensor-stack/xtl/include/xtl/xhalf_float_impl.hpp:4022:17: error: expected unqualified-id
 4022 |                 std::terminate();
      |                               ^
2 warnings and 2 errors generated.
make[2]: *** [test/CMakeFiles/test_xtl.dir/test_xhalf_float.cpp.o] Error 1
make[1]: *** [test/CMakeFiles/test_xtl.dir/all] Error 2
make: *** [all] Error 2
Building of project xtl did not succeed - exiting now

I use the same install script as I did in Linux, where it compiled without errors. Does MacOS(clang) require different setup options than Linux(gcc)?

Activity

  1. JohanMabille commented on Oct 14, 2025

    @JohanMabille
    Member

    I think we're missing some include (std::terminate is defined in the header <exception>, which is not included in xhalf_float_impl.hpp. We may be more lucky on Linux where it is probably included by other headers. Adding the missing include to xhalf_float_impl.hpp should probably fix your issue, although I'm a bit surprised we did not catch it in the CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions