1

During the tutorial on https://developers.eos.io/eosio-home/docs at the last step (step 2.9, the section about deferred transactions) when trying to compile the code, I get this error:

[*** addressbook]$ eosio-cpp -o addressbook.wasm addressbook.cpp -I ../abcounter/ -dI
warning: argument unused during compilation: '-dI' [-Wunused-command-line-argument]
/home/*****/eos/contracts/addressbook/addressbook.cpp:119:11: error: no type named 'transaction' in namespace 'eosio'
          eosio::transaction deferred;
          ~~~~~~~^
Warning, empty ricardian clause file
Warning, empty ricardian clause file
Warning, action <upsert> does not have a ricardian contract
Warning, action <erase> does not have a ricardian contract
Warning, action <notify> does not have a ricardian contract
1 error generated.
Error while processing /home/*****/eos/contracts/addressbook/addressbook.cpp.
abigen error

Why would there not be any eosio::transaction found? This should be part of the core cdt libraries, shouldn't it? Did I do something wrong when providing the library path?

1

I have found a solution, but I am unsure if this is the right way to do it.

The included files were under /usr/opt/eosio.cdt/1.6.1/include/eosiolib/contracts/eosio/ From there, it seems that the file transaction.hpp is included only in permission.hpp, but permission.hpp is not included anywhere:

[***** addressbook]$ grep -HiR "transaction.hpp" /usr/opt/eosio.cdt/1.6.1/include/eosiolib/contracts/eosio/
/usr/opt/eosio.cdt/1.6.1/include/eosiolib/contracts/eosio/permission.hpp:#include "transaction.hpp"
[***** addressbook]$ grep -HiR "permission.hpp" /usr/opt/eosio.cdt/1.6.1/include/eosiolib/contracts/eosio/
[***** addressbook]$

The tutorial's sample files all start with only #include <eosio/eosio.hpp>. Adding a line with #include <eosio/permission.hpp> makes compiling able to succeed, althogh there are now some warnings which were not there before:

In file included from /tmp/addressbook.cpp:1:
/usr/opt/eosio.cdt/1.6.1/bin/../include/eosiolib/contracts/eosio/permission.hpp:53:4: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^
/usr/opt/eosio.cdt/1.6.1/bin/../include/eosiolib/contracts/eosio/permission.hpp:78:4: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^

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.