-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
I am using VS Code wiht C++ extension on Ubuntu 16.04 to navigate code. IN the following code, I got a red wiggle under print saying
identifier "print" is not defined
print is defined in eosiolib/print.hpp which is in /usr/local/include which is in the includePath and browse path in c_cpp_properties.json. When I do "go to definition on "print" , it takes me to a definition of print in boost library which does not match the signature.
In eosiolib/print.hpp, there is a line
static_assert( sizeof(long) == sizeof(int), "unexpected size difference" );
I copy that line over and added to the following code. There is a red wiggle under static_assert saying
static assertion failed with "unexpected size difference"
Is this possible the reason why the definition of print in eosiolib/print.hpp not seen by VS code? how to make VS code to ignore such assert to bring in the definition of print?
#include <eosiolib/eosio.hpp>
#include <eosiolib/print.hpp>
using namespace eosio;
class hello : public eosio::contract {
public:
using contract::contract;
static_assert( sizeof(long) == sizeof(int), "unexpected size difference" );
/// @abi action
void hi( account_name user ) {
require_auth( user );
print( "Hello, ", name{user} );
}
void hhi( account_name user, uint64_t num) {
require_auth( user );
print( "Hello hhi, ", name{user}, "num is ", num );
}
};
EOSIO_ABI( hello, (hi)(hhi) )