Note that there are some explanatory texts on larger screens.

plurals
  1. POLNK 2019 unresolved external symbol...again
    text
    copied!<p>So I've read most post down here regarding this error, I'm still unable to understand the cause of my error. The project consists of 2 header files along with cpp implementations + main cpp file. </p> <p>DbApi.h contains definitions for functions implemented in DbApi.cpp. Linker.h contains definitions for functions called by Source.cpp, while Linker.cpp contains their implementations, which are calling functions from DbApi.h </p> <p>Linker.h</p> <pre><code>#ifndef LINKER_DEFINED #define LINKER_DEFINED #include "DbAPI.h" enum Short_Result_Code{...}; Short_Result_Code createNewCategory(string name, list &lt;int&gt; &amp;Parents); #endif </code></pre> <p>Linker.cpp</p> <pre><code>#include "Linker.h" Short_Result_Code createNewCategory(string name, list &lt;int&gt; &amp;Parents) { int RC = db::addCategory(name, Parents); if(RC==0) return OK; else return ERROR; } </code></pre> <p>DbApi.h</p> <pre><code>#ifndef __dbAPI_H_INCLUDED #define __dbAPI_H_INCLUDED namespace db { int addCategory(string name, list &lt;int&gt; parents); } #endif </code></pre> <p>DbApi.cpp</p> <pre><code>#include "DbAPI.h" namespace db { int addCategory(string name, list &lt;int&gt; parents) { // implementation }; } </code></pre> <p>main.cpp</p> <pre><code>#include "Linker.h" int main { list&lt;int&gt; A; A.push_back(1); A.push_back(2); string d = "ABC"; createNewCategory(d, A); } </code></pre> <ul> <li><p>error:</p> <p>error LNK2019: unresolved external symbol "enum Short_Result_Code __cdecl createNewCategory(class std::basic_string,class std::allocator >,class std::list > &amp;)" (?createNewCategory@@YA?AW4Short_Result_Code@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAV?$list@HV?$allocator@H@std@@@3@@Z) referenced in function _main F:\AeroFS\Work\ETI\PDFAccess\PDFAccess\Source.obj PDFAccess</p></li> </ul> <p>Where am I getting this wrong?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload