root-project / cling

The cling C++ interpreter
Other
3.55k stars 272 forks source link

Unresolved symbols when using std::future and std::async #387

Open mmoelle1 opened 3 years ago

mmoelle1 commented 3 years ago

When running the following code with the official binary cling_2020-11-05_ROOT-centos7

#include <future>
#include <thread>
std::future<int> f2 = std::async(std::launch::async, []{ return 8; });

I am receiving the following error

IncrementalExecutor::executeFunction: symbol '__emutls_v._ZSt11__once_call' unresolved while linking function '_GLOBAL__sub_I_cling_module_2'!
IncrementalExecutor::executeFunction: symbol '__emutls_v._ZSt15__once_callable' unresolved while linking function '_GLOBAL__sub_I_cling_module_2'!

I have seen certain other issues about this problem but cannot find a working solution nor the statement that this an open problem. Any help is appreciated.

SimeonEhrig commented 3 years ago

I have the same problem: https://github.com/root-project/cling/issues/321 A workaround is to compile Clang with the libc++.