April 17, 2022 [Issue 23025] New: ImportC: duplicate symbol for declaration and definition of variable | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23025 Issue ID: 23025 Summary: ImportC: duplicate symbol for declaration and definition of variable Product: D Version: D2 Hardware: All OS: Mac OS X Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: dave287091@gmail.com The following C program will fail to link with a duplicate symbol error. ``` const char *s; // tentative definition const char *s = “hello”; // definition int puts(const char*); int main(void){ puts(s); return 0 } ``` duplicate symbol '_s' in: dup.o ld: 1 duplicate symbol for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Error: linker exited with status 1 -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply