The problem is that "static const uint32_t KTX_FOO = 1;” in the class declaration doesn’t actually define an object. I need to add
const uint32_t texture::KTX_FOO = 1;
after the class declaration. Then things work.
However this makes it very awkward to export values represented in an enum in the C++ API to Javascript. It has to be mentioned 3 times
class texture {
static const uint32_t KTX_FOO;
};
const uint32_t KTX_FOO = static_cast<uint32_t>(c++_texture::enum_val);
and then in the bindings
.class_property(“KTX_FOO”, &wrapper::texture::KTX_FOO)
Is there anyway to automate this binding? IT is very tedious and error prone especially if ifdefs are involved.
Other than reading the source code, is there any complete documentation for embind? I haven’t been able to find any documents that mention class_property.
A happy New Year to all.
-Mark