Until eosio.cdt v1.6
You could use:
From eosio.cdt v1.6 onwards
You have to #include <eosio/system.hpp> and then you can use:
Problem solved ! I didn't go through the CHANGELOG for the latest 1.2 to 1.3 upgrade.
It turns out, the EOSIO_ABI macro has been renamed EOSIO_DISPATCH and so, it seems there is no problem with compilation on my machine.
One thing is remaining, but is linked to ABI generation, for which I took the decision to write it manually.
The problem here was that the path provided was relative, and Rohan was working with a docker container. When passing the path to your contract's directory when using docker, it should be an absolute path, and match the mounted path of your docker container.
cleos set contract helocode1234 /contracts/hello helo.wasm helo.abi -p helocode1234@active
Well, what I learnt from EOS developers Telegram group:
Update eosio.cdt. The latest version is 1.3.2
Also, although the tutorial says not to use abigen since abi is included...we need to use abigen since eosio.token.abi is not included in the download. So the command need to be changed as below:
eosio-cpp -I include -o eosio.token.wasm src/eosio.token....
With eosiocpp everything works fine because types.hpp is defined in the directory ...\eos\contracts\eosiolib. In eosio.cdt in ...\eosio.cdt\libraries\eosiolib there is only types.h and not types.hpp and so types.hpp cannot be found.
You could use of the newest macros:
Added ACTION macro which is simply a shortcut for [[eosio::action]]
Added TABLE macro which is simply a shortcut for struct
Added CONTRACT macro which is simply a shortcut for
When you're generating your ABI consider a few things:
Use the new command eosio-cpp
eosio-cpp -I include -o my_contract.wasm my_contract.cpp -abigen
Use the C++ 11 attributes included in the newest EOSIO version such as [[eosio::action]], [[eosio::table]], [[eosio::contract]]
If the contract structure is too complicated at this point "abigen" ...
You need to download the hpp & cpp files:
$ wget https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/eosio.token/include/eosio.token/eosio.token.hpp
$ wget https://raw.githubusercontent.com/EOSIO/eosio.contracts/master/eosio.token/src/eosio.token.cpp
Next, change import statement:
$ vim eosio.token.cpp
change line 6: include "eosio.token....
Multiple inheritance not supported for this particular case means that you can only have a tuple of single type.
typedef std::tuple<double> location_t;
According to this answer one is not able to use tuple.
Can somebody also confirm that this is the case?
Just replaced tuple with struct to avoid this headache. It's weird that tuple is used ...
you need extra comments marked in hpp file to help eosiocpp generate concrete abi file. for actions, you need to add comment
above its declaration. for multi_index table, you need to add comment
//@abi table <underlying class or struct name> (i64|i32)
above the underlying class or struct definition.