digitalmars.D.learn - _memsetFloat Error with dmd
- Maximilian Naderer (41/41) Mar 17 Hello people,
- Maximilian Naderer (29/70) Mar 17 Sorry the example should have been
- Paul Backus (4/15) Mar 17 This is a known bug in BetterC:
Hello people, i have the following example. Compiled with dmd and ldc2 dmd main.d -betterC ldc2 main.d -betterC with dmd the compilation fails with lld-link: error: undefined symbol: _memsetFloat >>> referenced by app.obj:(main) Error: linker exited with status 1 C:\dev\dlang\dmd2\windows\bin64\lld-link.exe /NOLOGO "app.obj" /LIBPATH:"C:\dev\dlang\dmd2\windows\bin64\..\lib64\mingw The compilation fails only with dmd when I'm not assigning all error ? ```d struct MyStruct { float[4] data; float[16] matrix; } extern(C) int main() { MyStruct sWorks = MyStruct( data: [1.0f, 2.0f, 3.0f, 4.0f], matrix: [ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f ]); MyStruct sWorks2; sWorks2.data = [ 1.0f, 0.0f, 0.0f, 1.0f ]; MyStruct sNotWorking = MyStruct( data: [ 1.0f, 0.0f, 0.0f, 1.0f ], matrix: [ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f ]); return 0; } ```
Mar 17
On Monday, 17 March 2025 at 12:28:38 UTC, Maximilian Naderer wrote:Hello people, i have the following example. Compiled with dmd and ldc2 dmd main.d -betterC ldc2 main.d -betterC with dmd the compilation fails with lld-link: error: undefined symbol: _memsetFloat >>> referenced by app.obj:(main) Error: linker exited with status 1 C:\dev\dlang\dmd2\windows\bin64\lld-link.exe /NOLOGO "app.obj" /LIBPATH:"C:\dev\dlang\dmd2\windows\bin64\..\lib64\mingw The compilation fails only with dmd when I'm not assigning all error ? ```d struct MyStruct { float[4] data; float[16] matrix; } extern(C) int main() { MyStruct sWorks = MyStruct( data: [1.0f, 2.0f, 3.0f, 4.0f], matrix: [ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f ]); MyStruct sWorks2; sWorks2.data = [ 1.0f, 0.0f, 0.0f, 1.0f ]; MyStruct sNotWorking = MyStruct( data: [ 1.0f, 0.0f, 0.0f, 1.0f ], matrix: [ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f ]); return 0; } ```Sorry the example should have been ```d struct MyStruct { float[4] data; float[16] matrix; } extern(C) int main() { MyStruct sWorks = MyStruct( data: [1.0f, 2.0f, 3.0f, 4.0f], matrix: [ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f ]); MyStruct sWorks2; sWorks2.data = [ 1.0f, 0.0f, 0.0f, 1.0f ]; MyStruct sNotWorking = MyStruct( matrix: [ 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f ]); return 0; } ```
Mar 17
On Monday, 17 March 2025 at 12:28:38 UTC, Maximilian Naderer wrote:Hello people, i have the following example. Compiled with dmd and ldc2 dmd main.d -betterC ldc2 main.d -betterC with dmd the compilation fails with lld-link: error: undefined symbol: _memsetFloat >>> referenced by app.obj:(main) Error: linker exited with status 1 C:\dev\dlang\dmd2\windows\bin64\lld-link.exe /NOLOGO "app.obj" /LIBPATH:"C:\dev\dlang\dmd2\windows\bin64\..\lib64\mingwThis is a known bug in BetterC: https://github.com/dlang/dmd/issues/19579
Mar 17