Hi,

I have some issues, the get this program working on ubuntu:

``` Dockerfile
FROM ubuntu:focal

RUN apt-get update && apt-get upgrade -y \
&& apt-get install --no-install-recommends -y build-essential ldc dub zlib1g-dev

COPY app.d /tmp/
RUN dub build --single /tmp/app.d -v
```

``` app.d
/+ dub.sdl:
    name "app"
    lflags "-lz" "-ldl"
    dflags "-static"
+/
import std;
void main(){}
```

Linker fails with error messages like these:
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libphobos2-ldc.a(zlib.o):function
 _D3std4zlib8Compress5errorMFiZv: error: undefined reference to 'deflateEnd'
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libphobos2-ldc.a(zlib.o):function
 _D3std4zlib8Compress6__dtorMFZv: error: undefined reference to 'deflateEnd'

The actual link command looks right:
/usr/bin/ldc2 -oftmp/.dub/build/application-debug-linux.posix-x86_64-ldc_2090-ED4668B88284A40FA4668246697CB2B5/app tmp/.dub/build/application-debug-linux.posix-x86_64-ldc_2090-ED4668B88284A40FA4668246697CB2B5/app.o -L--no-as-needed -L-lz -L-ldl -static -g

Do you have an idea?

Kind regards
André

Reply via email to