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?

  • i am facing the same issue while making a smart contract using cpr library,did you get any work around it? or any other library instead of cpr that works with eosio? I am using eosio.cdt 1.6.3 on Ubuntu 18.04 LTS – Neel Banker Oct 17 '19 at 13:38
  • No, I dropped that little project.Now I am focused on other that does not have such need to use future . – Tigran Sahakyan Oct 17 '19 at 13:58
  • I see, but is there any way to implement response request of API in smart contract in eosio? and did you find anything? – Neel Banker Oct 18 '19 at 9:53

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 '19 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 '19 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.