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


#pragma once

#include <eosiolib/eosio.hpp>

using namespace eosio;

namespace testcts {
    class [[eosio::contract("testct")]] test : public contract {
            test(name receiver, name code, datastream<const char*> ds) : contract(receiver, code, ds) { }

            ACTION testact( name user );


#include "test.hpp"

namespace testcts {
    void test::testact( name user ) {
        require_auth( user );

1 Answer 1


For me the error disappears when I use the -o flag to explicitly specify output file:

eosio-cpp -o test.wasm test.cpp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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