Why do I still get “unresolved external symbol” error after adding the reference to the test project?
问题 I created a C++ project in Visual Studio 2019. I added two files to it: MyClass.hpp and MyClass.cpp . Then I created a test project and added the original project as a reference. If I doubleclick on the reference in the test project, I can see MyClass . But if I try to run the tests, I get this error: MyTest.obj : error LNK2019: unresolved external symbol "public: struct MyRef __thiscall MyClass::SetData(struct Data)" (?SetData@MyClass@@QAE?AUMyRef@@UData@@@Z) referenced in function "private: