-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
squiz-box has been working wonderfully in a debug/plain build, but a release/release-debug build produces linker errors. I'm currently learning D (my background is C/C++) so this might be something I'm doing wrong.
Platform
$ uname -srvmpio
Linux 6.14.0-33-generic #33~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 19 17:02:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Debug build output
$ dub --build=debug
Starting Performing "debug" build using /home/lynx/Packages/dmd/dmd-2.111.0/linux/bin64/dmd for x86_64.
Building squiz-box 0.3.0: building configuration [library]
Building squiz ~master: building configuration [application]
Linking squiz
Running squiz
Compressed 22 bytes to 80 bytes
Release build output
$ dub --build=release
Starting Performing "release" build using /home/lynx/Packages/dmd/dmd-2.111.0/linux/bin64/dmd for x86_64.
Building squiz-box 0.3.0: building configuration [library]
Building squiz ~master: building configuration [application]
Linking squiz
/usr/bin/ld: /home/lynx/.dub/cache/squiz/~master/build/application-release-PWrj3ReYlXfBvVR9wi8Diw/squiz.o: in function `_D3std5array__T15InPlaceAppenderTAC9squiz_box3box10UnboxEntryZQBv11__xopEqualsMxFKxSQDeQDd__TQDaTQCmZQDiZb':
source/app.d:(.text._D3std5array__T15InPlaceAppenderTAC9squiz_box3box10UnboxEntryZQBv11__xopEqualsMxFKxSQDeQDd__TQDaTQCmZQDiZb[_D3std5array__T15InPlaceAppenderTAC9squiz_box3box10UnboxEntryZQBv11__xopEqualsMxFKxSQDeQDd__TQDaTQCmZQDiZb]+0x47): undefined reference to `_D4core8internal5array8equality__T8__equalsTxC9squiz_box3box10UnboxEntryTxQBdZQBsFMAxQBoMQgZb'
/usr/bin/ld: /home/lynx/.dub/cache/squiz/~master/build/application-release-PWrj3ReYlXfBvVR9wi8Diw/squiz.o: in function `_D3std5array__T15InPlaceAppenderTAC9squiz_box3box10UnboxEntryZQBv8toStringMxFZAya':
source/app.d:(.text._D3std5array__T15InPlaceAppenderTAC9squiz_box3box10UnboxEntryZQBv8toStringMxFZAya[_D3std5array__T15InPlaceAppenderTAC9squiz_box3box10UnboxEntryZQBv8toStringMxFZAya]+0xd0): undefined reference to `_D3std6format5write__T11formatValueTSQBj5array__T15InPlaceAppenderTAyaZQwTxAC9squiz_box3box10UnboxEntryTaZQDgFKQCxKxQBpMKxSQErQEq4spec__T10FormatSpecTaZQpZv'
collect2: error: ld returned 1 exit status
Error: undefined reference to `bool core.internal.array.equality.__equals!(const(squiz_box.box.UnboxEntry), const(squiz_box.box.UnboxEntry)).__equals(scope const(squiz_box.box.UnboxEntry)[], scope const(squiz_box.box.UnboxEntry)[])`
referenced from `const bool std.array.InPlaceAppender!(squiz_box.box.UnboxEntry[]).InPlaceAppender.__xopEquals(ref const(std.array.InPlaceAppender!(squiz_box.box.UnboxEntry[]).InPlaceAppender))`
Error: undefined reference to `void std.format.write.formatValue!(std.array.InPlaceAppender!(immutable(char)[]).InPlaceAppender, const(squiz_box.box.UnboxEntry[]), char).formatValue(ref std.array.InPlaceAppender!(immutable(char)[]).InPlaceAppender, ref const(squiz_box.box.UnboxEntry[]), scope ref const(std.format.spec.FormatSpec!(char).FormatSpec))`
referenced from `const immutable(char)[] std.array.InPlaceAppender!(squiz_box.box.UnboxEntry[]).InPlaceAppender.toString()`
perhaps `.d` files need to be added on the command line, or use `-i` to compile imports
Error: linker exited with status 1
cc /home/lynx/.dub/cache/squiz/~master/build/application-release-PWrj3ReYlXfBvVR9wi8Diw/squiz.o -o /home/lynx/.dub/cache/squiz/~master/build/application-release-PWrj3ReYlXfBvVR9wi8Diw/squiz -m64 -Xlinker --no-as-needed -Xlinker --export-dynamic /home/lynx/.dub/cache/squiz-box/0.3.0/build/library-release-fwpNIs-UI5OprO7yTJegmg/libsquiz-box.a -llzma -lzstd -lbz2 -L/home/lynx/Packages/dmd/dmd-2.111.0/linux/bin64/../lib64 -Xlinker -Bstatic -lphobos2 -Xlinker -Bdynamic -lpthread -lm -lrt -ldl
Error /home/lynx/Packages/dmd/dmd-2.111.0/linux/bin64/dmd failed with exit code 1.
File: app.d
import std.range;
import std.stdio;
import squiz_box;
enum testData = "This is some test data";
void main()
{
const(ubyte)[] compressedData = only(cast(ubyte[])testData).compressXz().join();
writefln("Compressed %d bytes to %d bytes", testData.length, compressedData.length);
}File: dub.json
{
"authors": [
"frofflehop"
],
"dependencies": {
"squiz-box": "~>0.3.0"
},
"description": "Test squiz-box",
"license": "proprietary",
"name": "squiz"
}File: dub.selections.json
{
"fileVersion": 1,
"versions": {
"squiz-box": "0.3.0"
}
}Tools
$ dub --version
DUB version 1.40.0, built on Mar 31 2025
$ dmd --version
DMD64 D Compiler v2.111.0
Copyright (C) 1999-2025 by The D Language Foundation, All Rights Reserved written by Walter Bright
$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.42
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public Licence version 3 or (at your option) a later version.
This program has absolutely no warranty.
Installed libraries
$ apt list | grep -E '(liblzma|libbz2|libzstd).*installed'
libbz2-1.0/noble-updates,now 1.0.8-5.1build0.1 amd64 [installed]
libbz2-1.0/noble-updates,now 1.0.8-5.1build0.1 i386 [installed,automatic]
libbz2-dev/noble-updates,now 1.0.8-5.1build0.1 amd64 [installed]
liblzma-dev/noble-updates,noble-security,now 5.6.1+really5.4.5-1ubuntu0.2 amd64 [installed]
liblzma5/noble-updates,noble-security,now 5.6.1+really5.4.5-1ubuntu0.2 amd64 [installed]
liblzma5/noble-updates,noble-security,now 5.6.1+really5.4.5-1ubuntu0.2 i386 [installed,automatic]
libzstd-dev/noble-updates,now 1.5.5+dfsg2-2build1.1 amd64 [installed]
libzstd1/noble-updates,now 1.5.5+dfsg2-2build1.1 amd64 [installed]
libzstd1/noble-updates,now 1.5.5+dfsg2-2build1.1 i386 [installed,automatic]
Metadata
Metadata
Assignees
Labels
No labels