Error: cannot use non-constant CTFE pointer in an initializer `cast(immutable(char)*)TEST`

test123 test123 at gmail.com
Sat Jun 11 10:07:46 UTC 2022


how to work this around.

```d
__gshared const TEST = import(`onlineapp.d`);
extern(C) void main(){
  	__gshared  bin_ptr = TEST.ptr;
}
```

```sh
dmd2 -betterC -J. onlineapp.d
onlineapp.d(3): Error: cannot use non-constant CTFE pointer in an 
initializer `cast(immutable(char)*)TEST`

```


More information about the Digitalmars-d-learn mailing list