为什么有未定义的错误?
file_1.cpp
#include <iostream>
using namespace std;
extern const int bufSize = 512;
main()
{
cout << bufSize << endl;
system("pause");
return 0;
}
file_2.cpp
#include <iostream>
using namespace std;
extern const int bufSize;
int main()
{
cout << bufSize << endl;
system("pause");
return 0;
}
为什么file_2.cpp的bufSize连接器找不到?