这是indexloc提供的服务,不要输入任何密码
Skip to content

Link error of call get_system_scheduler() #1477

@yonghuier

Description

@yonghuier

Description:

I'm encountering an issue when using exec::get_system_scheduler() in my code. The code compiles successfully when using exec::static_thread_pool, but it fails when using exec::get_system_scheduler().

Code:

void l3_scheduler() {
  stdexec::scheduler auto sch = exec::get_system_scheduler();
  stdexec::sender auto computation =
    stdexec::schedule(sch) | stdexec::then([] {
      fmt::println("Hello, from a different thread");
    });
  stdexec::sync_wait(std::move(computation));
}

The error message is as follows:

"__query_system_context_interface(__uuid const&)", referenced from:
    l3_scheduler() in main.cpp.o
 ld: symbol(s) not found for architecture arm64

The following code works without issues:

exec::static_thread_pool pool(8);
auto sch = pool.get_scheduler();

Environment:

  • macOS: M1 MacBook Pro (arm64)

  • Ubuntu: x86 architecture

  • Compiler: clang++-19

Steps to Reproduce:

  1. Use stdexec::scheduler with exec::get_system_scheduler().

  2. Attempt to compile the code on macOS M1 or Ubuntu (x86).

  3. Observe the linker error.

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