From 16426601d63ecd24e22145456177e4fdb8ab48a4 Mon Sep 17 00:00:00 2001 From: Walter Bright Date: Fri, 24 Nov 2023 00:42:20 -0800 Subject: [PATCH] fix Issue 24042 - ImportC: Error: no definition for static function (#15857) --- compiler/src/dmd/backend/cgen.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/dmd/backend/cgen.d b/compiler/src/dmd/backend/cgen.d index cb4192cbb18f..46ba31e93b8a 100644 --- a/compiler/src/dmd/backend/cgen.d +++ b/compiler/src/dmd/backend/cgen.d @@ -341,7 +341,8 @@ static if (TARGET_SEGMENTED) // outdata(Symbol *s) if (f.sym.Sseg == UNKNOWN) { - printf("Error: no definition for static %s\n", prettyident(f.sym)); // no definition found for static + error(null, 0, 0, "no definition found for static `%s` in this module, statics defined in one module cannot be referenced from another", + prettyident(f.sym)); // no definition found for static err_exit(); // BUG: do better } }