Just a general c++ question, im sure somebody here can answer.
Why is it that if you declare a vector in one cpp
//main.cpp
std::vector<int> myVec
Then 'tell' another cpp about it via the extern command
//other.cpp
extern std::vector<int> myVec
Everything works fine. This works for any data type (ints, floats, even custom data structs). HOWEVER! For some krazy ass reason this ONLY works IF the vector is declared in a cpp. If you declare the vector in a header, and include that header in the main cpp you get the following error...
: error LNK2001: unresolved external symbol "class std::vector<int,class std::allocator<int> > myVec" (?myVec@@3V?$vector@HV?$allocator@H@std@@@std@@A)
The krazy part is, this is ONLY a problem with vectors. EVERY other data type can be externed just fine, if its declared in a cpp, header, doesnt matter. Why?!
All you need is zeal