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

error:no matching function for call to 'obx::Box<Task>::put(<brace-enclosed initializer list>) #7

Closed
Laganer opened this issue Jul 30, 2020 · 3 comments

Comments

@Laganer
Copy link

Laganer commented Jul 30, 2020

when I compile the example by running: g++ main.cpp -I. -std=c++11 -lobjectbox
error:no matching function for call to 'obx::Box::put()

obx_id id = box.put({.text = "Buy milk"})
^

int main()
{
obx::Store store(create_obx_model());
obx::Box box(store);

obx_id id = box.put({.text = "Buy milk"});  //  error code

std::unique_ptr task = box.get(id); // Read
if (task) {
task->text += " & some bread";
box.put(*task); // Update
box.remove(id); // Delete
}
return 0;
}

@greenrobot greenrobot transferred this issue from objectbox/objectbox-java Jul 30, 2020
@vaind
Copy link
Collaborator

vaind commented Jul 30, 2020

I've just tested the example you're probably referring to (https://cpp.objectbox.io/getting-started) and it worked for me - I've got no error.

Could you maybe zip the whole directory you've tried this in and attach it to the issue? So I can try to run the exact same code.
Also, what platform and compiler are you using? uname -a and g++ --version

@Laganer
Copy link
Author

Laganer commented Jul 31, 2020 via email

@vaind
Copy link
Collaborator

vaind commented Sep 1, 2020

Looks like the getting-started page answered the questions. Feel free to follow-up in case there's still an issue.

@vaind vaind closed this as completed Sep 1, 2020
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

2 participants