[Solved] Visual studio 2022 error LNK2019: unable to resolve external symbol for

Visual studio 2022 error reporting template:

1>*. Obj: error LNK2019: unresolved external symbol “… Void _cdecl…” (..), Function “…” (…?..) The symbol is referenced in

Detailed errors are as follows:

Generation started...
1>------ Generation has started: Project: BIOP, Configuration:Debug x64 ------
1>pRein.cpp
1>run_models.obj : error LNK2019: Unresolved external symbol "private: void __cdecl bTama::initiate(int,int,int,int)" ([email protected]@@[email protected]),Function "public: __cdecl bTama::bTama(void)" ([email protected]@[email protected]) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::insert(struct IntervalSub)" ([email protected]@@[email protected]@@Z),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected][email protected][email protected][email protected]@@@[email protected]@[email protected]@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: bool __cdecl bTama::deleteSubscription(struct IntervalSub)" ([email protected]@@[email protected]@@Z),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected][email protected][email protected][email protected]@@@[email protected]@[email protected]@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::forward_match_accurate(struct Pub const &,int &,class std::vector<struct IntervalSub,class std::allocator<struct IntervalSub> > const &)" ([email protected]@@[email protected]@[email protected]@@[email protected]@@@[email protected]@@[email protected]@@Z),函数 "void __cdecl run_btama_forward(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected][email protected][email protected][email protected]@@@[email protected]@[email protected]@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::backward1_match_accurate(struct Pub const &,int &,class std::vector<struct IntervalSub,class std::allocator<struct IntervalSub> > const &)" ([email protected]@@[email protected]@[email protected]@@[email protected]@@@[email protected]@@[email protected]@@Z),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected][email protected][email protected][email protected]@@@[email protected]@[email protected]@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::backward2_match_accurate(struct Pub const &,int &,class std::vector<struct IntervalSub,class std::allocator<struct IntervalSub> > const &)" ([email protected]@@[email protected]@[email protected]@@[email protected]@@@[email protected]@@[email protected]@@Z),Function "void __cdecl run_btama_backward2(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected][email protected][email protected][email protected]@@@[email protected]@[email protected]@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: int __cdecl bTama::calMemory(void)" ([email protected]@@QEAAHXZ),Function "void __cdecl run_btama_backward1(class intervalGenerator const &,class std::unordered_map<int,bool,struct std::hash<int>,struct std::equal_to<int>,class std::allocator<struct std::pair<int const ,bool> > >)" ([email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected][email protected][email protected][email protected]@@@[email protected]@[email protected]@@Z) Referenced in
1>D:\codes\BIOP\x64\Debug\BIOP.exe : fatal error LNK1120: 7 unresolved external commands
1>The operation to generate the project "BIOP.vcxproj" has been completed-failed.
========== Generation: 0 success, 1 failure, 0 latest, 0 skip ==========

reason:
After adding a new file on another computer or another operating system, submitting it to GitHub, and then returning to the current computer to pull the code, the new file is not imported into the VS project

Solution:
Add the newly created file to the current project, “head/source file→ \rightarrow→Add to→ \rightarrow→Existing items”

Read More: