Did you include
x.cpp
file in your project?
Did you include the required headers in both
y.cpp
and
x.cpp
source files?
The following test:
file
b.cpp
#include <vector>
#include <string>
using namespace std;
vector <string> v;
file
main.cpp
#include <vector>
#include <string>
#include <iostream>
using namespace std;
extern vector<string> v;
int main()
{
v.push_back(string("hi"));
cout << v[0] << endl;
}
compiles (and runs) fine.
:)