Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cpp]

The tag has no usage guidance.

0
votes
1answer
43 views

Passing the action name having return type to EOSIO_DISPATCH in EOSIO smart contract

I have following EOSIO smart contract: #include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio; class random : public contract { public: using contract::...
0
votes
1answer
88 views

How can I create a table in an .hpp for a general contract? (Using the CDT)

THE STRUCTURE OF MY PROJECT I am working in mycontract.cpp, which imports myheader.hpp WHAT I WANT I want to create a table in myheader.hpp, for a generic contract, "IN THEORY" as follows: struct [...
1
vote
1answer
95 views

Runtime Error Processing WASM in ``` std::stof```?

[[eosio::action]] void hi(){ string strNum; strNum.push_back('3'); float currNum = std::stof(strNum);// print("currNum=",currNum); } ...
1
vote
1answer
183 views

How to solve !action_type.empty(): Unknown action hi in contract hello?

I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract. This is the hello.cpp contract code which is successfully deployed: #include <eosiolib/eosio.hpp> #...
1
vote
0answers
60 views

How to solve !action_type.empty(): Unknown action hi in contract hello?

I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract. This is the hello.cpp contract code which is successfully deployed: #include <eosiolib/eosio.hpp> #...
0
votes
1answer
39 views

EOS CDT: where are the *.h and the *.cpp files stored in the filesystem, I need reference to them to compile

I'm trying to use the EOS CDT (contract development toolkit). I've downloaded and installed the repository from github, and used to following commands, as indicated from the eos.io development page. ...
2
votes
2answers
219 views

How to solve fatal error: 'eosiolib/types.hpp' file not found #include <eosiolib/types.hpp>?

After installing eosio.cdt 1.4.1, I am receiving this error from the compilation of my code where is included the header file eosiolib/types.hpp: fatal error: 'eosiolib/types.hpp' file not found ...
1
vote
1answer
81 views

How can i solve the error: iostreams currently clash with eosio::datastream?

I am trying to compile some code which compiled successfully with the old compiler eosiocpp, but with the new eosio-cpp gives me: eosio.cdt/1.4.0/bin/../include/libcxx/iostream:13:2: error: "iostreams ...
3
votes
1answer
127 views

Why smart contract function fails with “Error 3090004: Missing required authority”?

WHAT I WANT From the contract mycontract I want to call a function function1. The function function1 calls another function of mycontract called function2. The function function2 calls an action of ...
0
votes
1answer
38 views

How do I use C++11 on Mac?

I tried the hello world sample contract, and when it came time to compile, I got this error: hello.cpp:10:10: error: expected ']' [[eosio:action]] ^ ...
1
vote
1answer
79 views

Smart contract error while calling recover_key

Specs I am using the function recover_key from the library crypto.h at the following link: https://github.com/EOSIO/eos/blob/master/contracts/eosiolib/crypto.h Code int compressed_size = ...
1
vote
1answer
65 views

How to parse iso8601 to eos time format?

How does one parse an iso8601 string to eos time_point format?
0
votes
2answers
734 views

Transfer EOS tokens inside a smart contract from an account to another

I want to implement, in my smart contract(C++), a function that forwards EOS token to another account. This is actually a basic question, but is that possible actually? Please, could you share the ...
2
votes
2answers
70 views

How to use std::tuple with eosiocpp?

I am trying to use typedef std::tuple<double, double> location_t; to create a simple tuple with latitude and longitude, but eosiocpp gives me 2018-09-02T12:54:47.310 thread-0 main.cpp:105 ...