gofractally / demo-clsdk

Demonstration of using the clsdk to build and test contracts
13 stars 2 forks source link

duplicate symbol: mycontract::XXX() #11

Open 7flash opened 2 years ago

7flash commented 2 years ago

mycontract.hpp:

#include "constants.hpp"

namespace mycontract {
    class gnocityworks_contract : public contract {
        // ...
    }
}

constants.hpp:

#pragma once

namespace mycontract {
    void XXX() {};
}
swatanabe commented 2 years ago

Either define XXX in a .cpp file or declare it inline

7flash commented 2 years ago

Either define XXX in a .cpp file or declare it inline

Thank you, it worked perfectly, specifically had to add "inline" prefix to all functions in atomicassets contract

https://github.com/pinknetworkx/atomicassets-contract/tree/master/include

7flash commented 2 years ago

https://github.com/pinknetworkx/atomicassets-contract/issues/46