Looks like you need to use reinterpret_cast (
https://en.cppreference.com/w/cpp/language/reinterpret_cast ).

On Mon, 5 Jul 2021 at 02:18, Ben Wiley <[email protected]> wrote:

> Apologies if this is less of an embind question and more of a "how does
> interop work with C and C++" question. I"m a bit inexperienced using them
> together but in my case I'm trying to use embind, which requires bindings
> written in C++, and the library I want to link is written in C. When I try
> to link this library (https://github.com/korginc/volcasample) I get an
> error about implicit pointer type conversion:
>
> ../volcasample/syro/korg_syro_volcasample.c:713:23: error: assigning to
> 'uint8_t *' (aka 'unsigned char *') from incompatible type 'void *'
>                         psms[i].comp_buf = malloc(comp_dest_size +
> comp_ofs);
>                                            ^
>
> I suppose I could convert the library to valid C++ with correct casting
> but I'm hoping to avoid having to patch the source library in order to link
> it. Is there another way? A compiler flag to allow implicit pointer type
> casting or something like that?
>
> Thanks
> Ben
>
> --
> 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/ad71459d-9e32-4c16-bc2d-052f6c310badn%40googlegroups.com
> <https://groups.google.com/d/msgid/emscripten-discuss/ad71459d-9e32-4c16-bc2d-052f6c310badn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CA%2B_KjGbvDfG%3DvnGkAxo__OBP4Y-8Mf2ZS-TBgQHzUJzDPAPPjw%40mail.gmail.com.

Reply via email to