digitalmars.D.bugs - [Issue 23025] New: ImportC: duplicate symbol for declaration and
- d-bugmail puremagic.com (30/30) Apr 16 2022 https://issues.dlang.org/show_bug.cgi?id=23025
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 --
Apr 16 2022