char[]/ubyte[] compile error

Johan Engelen via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Wed Jul 12 14:28:13 PDT 2017


On Wednesday, 12 July 2017 at 21:14:09 UTC, Damien Gibson wrote:
> 
> 'Error: Internal Compiler Error: unsupported type char[]'
>
> a direct method of reproducing this is:
>
> 1) Make a shared library(dll).
> 2) Generate in some code file - Module Name,
>                                 export:extern(C++):,
>                                 use above type as return or 
> param;
> 3) Compile.

This is probably because `char[]` cannot be mangled to a C++ 
type. So you cannot have an extern(C++) function with a `T[]` 
(any slice) as return type or parameter type.

- Johan



More information about the digitalmars-d-ldc mailing list