Here is the full compiling cpp code:
#include <string>
#include <emscripten/bind.h>
#include <emscripten/val.h>
class Foo
{
public:
Foo(const char* a, const char* b, const char* c)
{
m_a = std::string(a);
m_b = std::string(b);
m_c = std::string(c);
}
private:
std::string m_a;
std::string m_b;
std::string m_c;
};
EMSCRIPTEN_BINDINGS(FooTest)
{
emscripten::class_<Foo>("Foo").
constructor<const char*, const char*, const char*>();
}
ב-יום שני, 7 באוגוסט 2023 בשעה 08:03:35 UTC+3, Shlomi Fish כתב/ה:
> Hi Ronny,
>
> On Sun, 6 Aug 2023 05:20:59 -0700 (PDT)
> Ronny Nissengold <[email protected]> wrote:
>
> > Hi all,
> > I am trying to wrap my code with embind, and I have a ctor which
> receives 3
> > in params of const char*.
> > So I wrote the following:
> > And got an error that says that PKc is not supported:
> > Cannot construct foo due to unbound types: PKc
> >
> > How can I rewrite the embinding please? I cannot change the CTOR
> function.
> >
> > EMSCRIPTEN_BINDINGS(contextTest) {
> > emscripten::class_<Foo>("foo").
> > constructor<const char*, const char*, const char*>();
> > }
> >
>
> please go over https://github.com/shlomif/how-to-share-code-online and
> follow
> its advice.
>
> --
>
> Shlomi Fish https://www.shlomifish.org/
> Beginners Site for the Vim text editor - https://vim.begin-site.org/
>
> The NSA knows what you did last summer. But no one, in the NSA or outside
> it,
> knows why they should.
> — https://www.shlomifish.org/humour/bits/facts/NSA/
>
> Please reply to list if it's a mailing list post - https://shlom.in/reply
> .
>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/emscripten-discuss/e34d53df-d7d7-4084-96df-0c2532a2de82n%40googlegroups.com.