Linker error cross compiling for raspberry pi

Jackson Slater gsjj28 at gmail.com
Tue May 14 00:29:26 UTC 2019


On Monday, 13 May 2019 at 20:29:06 UTC, Jackson Slater wrote:
> I am using ubuntu, trying to cross compile a d application for 
> Raspberry pi.
>
> I installed the "gdc-8-arm-linux-gnueabihf" package, but now 
> when I try to compile, I get a linker error:
>
> trying to cross-compile this:
> ---
> import std.stdio;
>
> void main()
> {
>   writeln("Hello, Pi!");
> }
> ---
>
> But when I compile (using the command 
> `arm-linux-gnueabihf-gdc-8 main.d`) I get this error:
>
> ---
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `deflateInit_'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `deflateInit2_'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `deflate'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `compress2'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `deflateEnd'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `crc32'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `inflate'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `inflateInit2_'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `inflateInit_'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `inflateEnd'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `inflateBackInit_'
> /usr/lib/gcc-cross/arm-linux-gnueabihf/8/libgphobos.so: 
> undefined reference to `adler32'
> collect2: error: ld returned 1 exit status
> ---
>
> Can anyone help me fix this?
> Thanks

Aha! It worked after following this 
https://github.com/pander86/raspberry_vibed


More information about the Digitalmars-d mailing list