2

I want to write a contract by using CPR library. Unfortunately I have an error:

fatal error: 'future' file not found
#include <future>

I am using EOSIO cdt v1.5.0 on Ubuntu 18.04.

I had the same with v1.4.1. I have build the v1.5.0 from the source hoping it will have needed header because I see a file ./libraries/libc++/libcxx/src/future.cpp in the repo.

Can you please help me?

1

It isn't possible to use future in smart contracts, because the whole thing is single-thread C++. Multithreading isn't supported and wouldn't work within the contract because it would potentially make the results of any code non-deterministic

  • I understand your opinion, but I found a 'thread' header file in eosio.cdt directory. file /usr/local/eosio.cdt/include/libcxx/thread – Tigran Sahakyan Feb 25 at 19:15
  • It isn't an opinion. If the smart contract was non-deterministic, then it wouldn't make sense to have it on a blockchain. Sorry but thats kind of in the definition. Perhaps B1 forgot to take it away when they built their libraries? – Phillip Hamnett - EOS42 Feb 25 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.