inline, weak symbol以及其他

首先,如果某个test.h里有如下内容: class A { public: int x(); }   int A::x() { }class A { public: int x(); } int A::x() { } 那如果只有一个test.cpp引用了它: #include "test.h"   int main() { A a; a.x(); }#include "test.h" int main() { A a; a.x(); } 那还好。但如果还有一个test2.cpp引用了它: #include "test.h"   int foo() { A a; a.x(); }#include "test.h" int …

Continue reading ‘inline, weak symbol以及其他’ »