I'm looking to use a hpp file as an interface for multiple contracts. I've created a test contract and receiving a WASM compilation error. I based the test contract on the format used by eosio.token.cpp/hpp.
/usr/opt/eosio.cdt/1.6.1/bin/wasm-ld: error: duplicate symbol: testcts::test::testact(eosio::name)
defined in /tmp/test.cpp.o
defined in /tmp/test.cpp.o
test.hpp
#pragma once
#include <eosiolib/eosio.hpp>
using namespace eosio;
namespace testcts {
class [[eosio::contract("testct")]] test : public contract {
public:
test(name receiver, name code, datastream<const char*> ds) : contract(receiver, code, ds) { }
ACTION testact( name user );
};
}
test.cpp
#include "test.hpp"
namespace testcts {
void test::testact( name user ) {
require_auth( user );
}
}