1

When I compile my code I get this error:

warning: missing terminating ' character const static uint32_t default_max_block_cpu_usage = 200'000; /// max block cpu usage in microseconds ^ error: missing terminating ' character const static uint32_t default_max_block_cpu_usage = 200'000; /// max block cpu usage in microseconds

How do I fix this?

1

I guess this is not directly related to EOS.IO, but you get the compile error because you are using a single quote to divide your uint.

This character is reserved for declaring chars. Here is a StackOverflow explanation to this: Single quotes vs. double quotes in C or C++

Just remove the ' from your definitions and it will hopefully work.

const static uint32_t   default_max_block_cpu_usage = 200000;
| improve this answer | |
  • this code is in ~/eosio/eos/libraries/chain/include/eosio/chain/config.hpp,and it can be compile by eos,i don't know how to do. – yilin wang Mar 4 '19 at 1:46
  • What is the compile command you are using? – TeeAttack42 Mar 4 '19 at 10:49
  • i just want in main.cpp add include #include <eosio/chain/contract_types.hpp> – yilin wang Mar 5 '19 at 2:43
  • g++ -o main main.cpp -I~/eosio/eos/libraries/fc/include -I~/eosio/eos/libraries/chain/include -I~/eosio/eos/libraries/chainbase/include -I~/eosio/eos/libraries/wasm-jit/Include -std=c++11 – yilin wang Mar 5 '19 at 2:44
  • 2
    Actually, modern C++ allows single quotes as digit separators, just for readability: 1'000'000'000 is more readable than 1000000000. For example, here it says that, since C++14, Optional single quotes(') may be inserted between the digits as a separator. They are ignored by the compiler. So perhaps changing the compiler options from -std=c++11 to -std=c++14 will help. – Gassa Apr 2 '19 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.