[Issue 23025] New: ImportC: duplicate symbol for declaration and definition of variable
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Apr 17 05:59:05 UTC 2022
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 at puremagic.com
Reporter: dave287091 at 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
--
More information about the Digitalmars-d-bugs
mailing list