例如: code1.c / .cpp int a; // … and so on code2.c / .cpp int a; int main(void) { return 0; } 去编译: $gcc code1.c code2.c # this is fine $ $g++ code1.cpp code2.cpp # this is dead /tmp/ccLY66HQ.o:(.bss+0x0): multiple definition of `a’ /tmp/ccnIOmPC.o:(.bss+0x0): first defined here collect2: ld returned 1 exit status C&C ++之间是否存在全局变量链接差异?