eosio.cdt1.7智能合约编译不了

ubuntu18.04环境,eosio.cdt采用deb安装,dpkg -L eosio.cdt发现安装在/usr/opt/eosio.cdt/1.7.0目录,写一个hello.cpp文件,编译出错

#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;
class hello : public contract {
    public:
        using contract::contract;
        [[eosio::action]]
            void hi( name user ) {
                print( "Hello, ", user);
            }
};
EOSIO_DISPATCH( hello, (hi))
#eosio-cpp -o hello.wasm hello.cpp --abigen
/eos/dapp/hello/hello.cpp:1:10: fatal error: 'eosiolib/eosio.hpp' file not found
#include <eosiolib/eosio.hpp>
         ^~~~~~~~~~~~~~~~~~~~

用find查找/usr/opt/eosio.cdt/1.7.0/include/eosiolib/contracts/eosio/eosio.hpp这个文件又存在,是否是环境变量没有设置,请教到底哪里出错。

请先 登录 后评论

2 个回答

cqhacker - 老师
  擅长:Dapp
请先 登录 后评论
石头
请先 登录 后评论
  • 1 关注
  • 0 收藏,3123 浏览
  • cqhacker 提出于 2020-04-10 22:29

相似问题