Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use runtime error #124

Open
jackfong123 opened this issue Jul 5, 2021 · 2 comments
Open

Use runtime error #124

jackfong123 opened this issue Jul 5, 2021 · 2 comments
Assignees

Comments

@jackfong123
Copy link

jackfong123 commented Jul 5, 2021

class Person
{
public:
     // constructor
    Person(const std::string& name)
        : m_name(name)
    {}
 
    // accessors for private members
    std::string name() const { return m_name; }
    void setName(const std::string& name) { m_name = name; }
 
    // public members
    float height;
    unsigned int shoeSize;
 
    // member function
    bool hasBigFeet() const { return shoeSize > 10; } // U.K.!
 
private:
    std::string m_name;
};
PONDER_TYPE(Person)     // declare the type to Ponder
 
static void declare()   // declare the class members to Ponder
{
    ponder::Class::declare<Person>("Person")
        .constructor<std::string>()
        .property("name", &Person::name, &Person::setName)
        .property("height", &Person::height)
        .property("shoeSize", &Person::shoeSize)
        .function("hasBigFeet", &Person::hasBigFeet)
        ;
}
int main(){
    declare();
    const ponder::Class& metaclass = ponder::classByType<Person>();
    ponder::UserObject data = ponder::runtime::create(metaclass, "Tom");
    //auto value = data.get("m_value");
    //std::cout << value << std::endl;   
    //data.set("m_value", 1000);
    return 0;
}

I compiled the demo code but got the following error:
undefined reference to `ponder::runtime::ObjectFactory::construct(ponder::Args const&, void*) const'

@billyquith billyquith self-assigned this Jul 6, 2021
@fish-king
Copy link

niuwaniuwa

@lamweilun
Copy link

I am getting the same issue, anyone has any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants