Proper way to deal with LNK errors

19 Views Asked by At

So I've been programming for a little while and I run into LNK errors all the time and just don't really know how to deal with them. Most often I get Unresolved external symbol or '. . . ' was already defined in . obj. This probably comes from how I include my header files. I have a header file and a matching cpp file and i include the header file anywhere where its needed. I dont know if thats ok to do. For example, I recently made a class with a static vector that I then included in several other . cpp files. Of course, I then immediately got an Unresolved external symbol error. Is there any proper way or rule to avoid these LNK2005 and LNK2019 mistakes.

0

There are 0 best solutions below