I building AddressBook by link https://developers.eos.io/eosio-home/docs/data-persistence,
Dependencies:
EOSIO.CDT (Contract Development Toolkit) Version : 1.3.1
Here is my code:
#include <eosiolib/eosio.hpp>
#include <eosiolib/action.hpp>
#include <eosiolib/contract.hpp>
#include <eosiolib/print.hpp>
#include <string>
using std::string;
using namespace eosio;
CONTRACT addressbook : public eosio::contract {
public:
using contract::contract;
ACTION hi( name user ) {
require_auth(user);
print( "Hello, ", name{user} );
}
private:
TABLE person {
uint64_t account_name;
string first_name;
string last_name;
string street;
string city;
string state;
uint32_t zip = 0;
uint64_t primary_key() const { return account_name; }
uint64_t by_zip() const { return zip; }
};
typedef eosio::multi_index<N(people), person> address_index;
};
EOSIO_DISPATCH( addressbook, (hi) )
Error message:
addressbook.cpp:55:35: error: use of undeclared identifier 'people'
typedef eosio::multi_index<N(people), person> address_index;