digitalmars.D - Linker error cross compiling for raspberry pi
- Jackson Slater (43/43) May 13 2019 I am using ubuntu, trying to cross compile a d application for
- Doc Andrew (4/7) May 13 2019 It looks like you're missing a dependency, probably zlib? You
- Jackson Slater (4/12) May 13 2019 Hm, there is no zlib-dev package, but there is zlib1g-dev, which
- kinke (2/3) May 13 2019 For armhf, your desired target architecture?
- Jackson Slater (3/6) May 13 2019 I don't think there is a prebuilt one for armhf. I am going to
- kinke (5/6) May 13 2019 Something like this should work:
- Jackson Slater (3/9) May 13 2019 Hm, I am getting a bunch of 404 errors now when running 'apt
- Jackson Slater (3/46) May 13 2019 Aha! It worked after following this
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
May 13 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. [...]It looks like you're missing a dependency, probably zlib? You should be able to install the zlib-dev package to resolve this. -Doc
May 13 2019
On Monday, 13 May 2019 at 22:44:19 UTC, Doc Andrew wrote:On Monday, 13 May 2019 at 20:29:06 UTC, Jackson Slater wrote:Hm, there is no zlib-dev package, but there is zlib1g-dev, which was already installed. Any other ideas? Thanks so muchI am using ubuntu, trying to cross compile a d application for Raspberry pi. [...]It looks like you're missing a dependency, probably zlib? You should be able to install the zlib-dev package to resolve this. -Doc
May 13 2019
On Monday, 13 May 2019 at 23:38:07 UTC, Jackson Slater wrote:but there is zlib1g-dev, which was already installedFor armhf, your desired target architecture?
May 13 2019
On Monday, 13 May 2019 at 23:42:37 UTC, kinke wrote:On Monday, 13 May 2019 at 23:38:07 UTC, Jackson Slater wrote:I don't think there is a prebuilt one for armhf. I am going to try cross compiling zlib.but there is zlib1g-dev, which was already installedFor armhf, your desired target architecture?
May 13 2019
On Monday, 13 May 2019 at 23:47:38 UTC, Jackson Slater wrote:I don't think there is a prebuilt one for armhf.Something like this should work: sudo dpkg --add-architecture armhf sudo apt-get update sudo apt-get install zlib1g-dev:armhf
May 13 2019
On Monday, 13 May 2019 at 23:51:30 UTC, kinke wrote:On Monday, 13 May 2019 at 23:47:38 UTC, Jackson Slater wrote:Hm, I am getting a bunch of 404 errors now when running 'apt update'.I don't think there is a prebuilt one for armhf.Something like this should work: sudo dpkg --add-architecture armhf sudo apt-get update sudo apt-get install zlib1g-dev:armhf
May 13 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
May 13 2019









Jackson Slater <gsjj28 gmail.com> 