[Issue 20668] Unresolved symbol (array equality) when using separate compilation
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 28 22:54:04 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=20668
Andrei Horodniceanu <a.horodniceanu at proton.me> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |a.horodniceanu at proton.me
--- Comment #1 from Andrei Horodniceanu <a.horodniceanu at proton.me> ---
This has come up as an issue in tilix
(https://github.com/gnunn1/tilix/issues/2210) making it uncompilable with dmd
and gdc when using meson due to these linking errors.
The reduced files for tilix are:
---------
module terminal;
import common;
import session;
class Terminal {
GenericEvent!() event;
}
---------
module common;
struct GenericEvent() {
int[] arr;
}
---------
module session;
import common;
import terminal;
class Session {
GenericEvent!() event;
}
---------
Compile with:
----
dmd -c terminal.d
dmd -c session.d
dmd -c common.d
dmd -of=main -main common.o session.o terminal.o
----
The results are:
----
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld:
session.o: in function
`_D6common__T12GenericEventZQp11__xopEqualsMxFKxSQBu__TQBqZQBuZb':
session.d:(.text._D6common__T12GenericEventZQp11__xopEqualsMxFKxSQBu__TQBqZQBuZb[_D6common__T12GenericEventZQp11__xopEqualsMxFKxSQBu__TQBqZQBuZb]+0x25):
undefined reference to
`_D4core8internal5array8equality__T8__equalsTiTiZQoFNaNbNiNeMxAiMxQeZb'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
cc common.o session.o terminal.o main.o -o main -m64 -Xlinker
--export-dynamic -Xlinker -rpath=/usr/lib/dmd/2.108/lib64
-L/usr/lib/dmd/2.108/lib64 -lphobos2 -lpthread -lm -lrt -ldl
----
--
More information about the Digitalmars-d-bugs
mailing list