Git Product home page Git Product logo

dappdevnotes's People

Contributors

thbourlove avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dappdevnotes's Issues

请问账户余额是如何build的?

@thbourlove
https://github.com/Dappub/DAPPDevNotes/blob/master/DAPP%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0-EOS-20180701.md
我按照您的上面步骤来获取某个账户的余额,
本地EOS环境已经OK,EOS的example也正常通过eoscpp编译生产wast文件。
现在是想通过cpp来获取余额。如下是我简单的代码:

 #include <eosio.token/eosio.token.hpp>
 #include <eosiolib/eosio.hpp>
 auto eos_token = eosio::token(N(eosio.token));
 auto balance = eos_token.get_balance('eos.io', symbol_type(S(4, EOS)).name());
 print("eos balance:",balance.amount);

然后连接库文件:

ln -s /your eos path/contracts/eosio.token /usr/local/include/

然后编译:

eosiocpp -o account.wast accountbalance.cpp

然后报错:

accountbalance.cpp:4:38: warning: multi-character character constant [-Wmultichar]
auto balance = eos_token.get_balance('eos.io', symbol_type(S(4, EOS)).name());
                                     ^
accountbalance.cpp:4:38: warning: character constant too long for its type
accountbalance.cpp:4:48: error: use of undeclared identifier 'symbol_type'
auto balance = eos_token.get_balance('eos.io', symbol_type(S(4, EOS)).name());
                                               ^
accountbalance.cpp:5:1: error: C++ requires a type specifier for all declarations
print("eos balance:",balance.amount);
^
2 warnings and 2 errors generated.

请问是哪里的问题呢?
对EOS的编译不是很理解,请帮忙纠正下错误,谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.