emscripten-core/emscripten
GitHub で見るbind failure with register_vector / "implicit instantiation of undefined template"
Open
#9,005 opened on 2019年7月16日
embindhelp wantedwontfix
Repository metrics
- Stars
- (27,361 stars)
- PR merge metrics
- (平均マージ 19d 10h) (30d で 147 merged PRs)
説明
Previously (emscripten-1.38.29), this code snippet worked and compiled without error:
std::vector<std::wstring> VectorAPI::createStringVector()
{
return std::vector<std::wstring>();
}
EMSCRIPTEN_BINDINGS(VectorAPI)
{
class_<VectorAPI>("VectorAPI")
.class_function("createStringVector", &VectorAPI::createStringVector);
register_vector<std::wstring>("vector<wstring>");
}
However, on the latest version, I get this instead:
In file included from src/api/VectorAPI.cpp:3:
In file included from src/api/VectorAPI.h:6:
/mnt/c/git/emsdk/upstream/emscripten/system/include/emscripten/bind.h:1423:13: error: implicit instantiation of undefined template 'emscripten::internal::RegisterClassMethod<unsigned long (std::__2::vector<std::__2::basic_string<wchar_t>, std::__2::allocator<std::__2::basic_string<wchar_t> > >::*)() const noexcept>'
invoker::template invoke<ClassType, Policies...>(methodName, callable);
^
/mnt/c/git/emsdk/upstream/emscripten/system/include/emscripten/bind.h:1600:14: note: in instantiation of function template specialization 'emscripten::class_<std::__2::vector<std::__2::basic_string<wchar_t>, std::__2::allocator<std::__2::basic_string<wchar_t> > >, emscripten::internal::NoBaseClass>::function<emscripten::internal::DeduceArgumentsTag, unsigned long (std::__2::vector<std::__2::basic_string<wchar_t>, std::__2::allocator<std::__2::basic_string<wchar_t> > >::*)() const noexcept>' requested here
.function("size", &VecType::size)
^
src/api/VectorAPI.cpp:26:5: note: in instantiation of function template specialization 'emscripten::register_vector<std::__2::basic_string<wchar_t> >' requested here
register_vector<std::wstring>("vector<wstring>");
^
/mnt/c/git/emsdk/upstream/emscripten/system/include/emscripten/bind.h:1150:16: note: template is declared here
struct RegisterClassMethod;
^
1 error generated.
shared:ERROR: compiler frontend failed to generate LLVM bitcode, halting
I have verified that I'm receiving the same error no matter what vector type I attempt to register (including primitives). I unfortunately can't stay on the older Emscripten version, due to some other issues.