找到一个或多个多重定义的文件
C/C++多文件编译
在C++/C中,多文件编译不需要引入其他自己写的cpp文件,只需要声明,但是只能有一个main()方法。比如在A.cpp中使用b.cpp中的test()方法,只需要在A.cpp中声明test()方法,关键字extern可加可不加例如:
//A.cpp
#include<bits/stdc++.h>
using namespace std;
extern void test();
int main()
{
test();
return 0;
}
//B.cpp
#include<bits/stdc++.h>
using namespace std;
void test() {
cout << "Hello world";
}