-
Just doing some testing with pybind. This example: #include <pybind11/pybind11.h>
namespace py = pybind11;
int add(int i, int j) {
return i * j;
}
PYBIND11_EMBEDDED_MODULE(example, m) {
m.doc() = "pybind11 example plugin"; // optional module docstring
m.def("add", &add, "A function which adds two numbers");
} Results in:
replacing Using pybind11 from current master |
Beta Was this translation helpful? Give feedback.
Answered by
sphaero
Dec 7, 2021
Replies: 1 comment
-
To answer my own question: it seems you need to include embed.h for it to work:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sphaero
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To answer my own question: it seems you need to include embed.h for it to work: