0

I am trying to add libcryptopp library to my contract but when I try to compile with eosio-cpp I get an error that header files cannot be found.

This is my code:

#include <eosiolib/eosio.hpp>
#include "cryptopp/integer.h"
#include "cryptopp/sha.h"
#include "cryptopp/cryptlib.h"
#include "cryptopp/files.h"
#include "cryptopp/hex.h"
using namespace CryptoPP;

class[[eosio::contract]] p2pgaming : public eosio::contract
{
public:
  using contract::contract;
  p2pgaming(eosio::name receiver, eosio::name code, eosio::datastream<const char *> ds) : contract(receiver, code, ds){}
   [[eosio::action]] 
   void printsha(std::string message)
  {
    SHA256 hash;
    std::string digest;
    StringSource s(message, true, new HashFilter(hash, new HexEncoder(new StringSink(digest))));
    eosio::print(digest);
  }
};

EOSIO_DISPATCH(p2pgaming, (printsha))
  • What error do you get? What command do you use to copmile eosio-cpp? Where are the libcryptopp lirbary files stored? If you give us useful information we are much more likely to be able to help – Phillip Hamnett - EOS42 Jan 9 at 11:16
  • @PhillipHamnett-EOS42 user has mentioned error read question carefully. – Mr.Y Jan 9 at 11:50
-1

your are getting that error because that header file may be cannot located at given location or you may try this syntax #include<cryptopp/integer.h>

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.