On Thursday, 17 January 2019 at 10:38:50 UTC, James Cranch wrote:
An attempt to compile it looks as follows:

| $ gdc executable.d -o executable

You need to pass all the modules you use to the compiler, or compile each one at a time and pass the resultant .o files to the linker together.

| /tmp/cc4RjTlb.o:(.data.rel+0x10): undefined reference to `_D7library12__ModuleInfoZ'

This just means the library module was missing from the final link. (if you remove the other call from it, it made the library do nothing and thus the compiler didn't even actually emit the call to it).

But try just

gdc executable.d -o executable library.d

so both .d files are on the list. That's the easiest and fastest way to make ti work.

Reply via email to