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?

3
  • 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 Commented Oct 17, 2019 at 13:38
  • No, I dropped that little project.Now I am focused on other that does not have such need to use future . Commented Oct 17, 2019 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? Commented Oct 18, 2019 at 9:53

1 Answer 1

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

2
  • I understand your opinion, but I found a 'thread' header file in eosio.cdt directory. file /usr/local/eosio.cdt/include/libcxx/thread Commented Feb 25, 2019 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? Commented Feb 25, 2019 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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