[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)" (?initiate@bTama@@AEAAXHHHH@Z),Function "public: __cdecl bTama::bTama(void)" (??0bTama@@QEAA@XZ) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: void __cdecl bTama::insert(struct IntervalSub)" (?insert@bTama@@QEAAXUIntervalSub@@@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> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: bool __cdecl bTama::deleteSubscription(struct IntervalSub)" (?deleteSubscription@bTama@@QEAA_NUIntervalSub@@@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> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@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 &)" (?forward_match_accurate@bTama@@QEAAXAEBUPub@@AEAHAEBV?$vector@UIntervalSub@@V?$allocator@UIntervalSub@@@std@@@std@@@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> > >)" (?run_btama_forward@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@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 &)" (?backward1_match_accurate@bTama@@QEAAXAEBUPub@@AEAHAEBV?$vector@UIntervalSub@@V?$allocator@UIntervalSub@@@std@@@std@@@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> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@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 &)" (?backward2_match_accurate@bTama@@QEAAXAEBUPub@@AEAHAEBV?$vector@UIntervalSub@@V?$allocator@UIntervalSub@@@std@@@std@@@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> > >)" (?run_btama_backward2@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@Z) Referenced in
1>run_models.obj : error LNK2019: Unresolved external symbol "public: int __cdecl bTama::calMemory(void)" (?calMemory@bTama@@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> > >)" (?run_btama_backward1@@YAXAEBVintervalGenerator@@V?$unordered_map@H_NU?$hash@H@std@@U?$equal_to@H@2@V?$allocator@U?$pair@$$CBH_N@std@@@2@@std@@@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: