[Issue 21750] New: -betterC undefined reference to _memsetn

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 23 18:11:15 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21750

          Issue ID: 21750
           Summary: -betterC undefined reference to _memsetn
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ryuukk.dev at gmail.com

The following code produces:

onlineapp.d:15: error: undefined reference to '_memsetn'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1


Only happen in with DMD -betterC, with LDC it compiles fine


Also on a more complex code base i get the following: 

 Error: `TypeInfo` cannot be used with -betterC

When creating a static array as local variable


```

struct Mat4
{
    float a;
}

struct Test
{
    char[64] a = 0;
    Mat4 b;
}

extern (C) int main()
{
    Test[1] test;
    return 0;
}
```

--


More information about the Digitalmars-d-bugs mailing list