title: error LNK2019: unresolved external symbol referenced in function main
body: <p>Am trying to run my simple assembly code in C++.I have only two files ".cpp" file and ".asm" file. On compiling it gives an error (see below ).I would appreciate if anyone could help...:)</p>
  
  <p>This is my "main.cpp" file</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  extern "C" int GetValueFromASM(); 
  
  int main(int argc, char *argv[]){
  
  cout&lt;&lt;"value is:"&lt;&lt;GetValueFromASM()&lt;&lt;endl;
  cin.get();
  
  return 0;
  }
  </code></pre>
  
  <p>Also i have a simple "asm.asm" file</p>
  
  <pre><code>.code
     GetValueFromASM proc
     mov rax,3254
     ret
     GetValueFromASM endp
  end
  </code></pre>
  
  <p>When  try to build i get this error :</p>
  
  <pre><code>1&gt;main.obj : error LNK2019: unresolved external symbol GetValueFromASM referenced in             
  function main
  
  1&gt;..\visual studio 2012\Projects\AllAssembly\x64\Debug\AllAssembly.exe : fatal error LNK1120: 1 unresolved externals
  </code></pre>
  
  <p>I tried go to PROPERTIES->LINKS->ADDITIONAL LIBRARY DIRECTORIES and change the path
  but it didn't work.</p>
  
  <p>I tried also go to LINKER->SYSTEM->SUBSYSTEM and Select "Windows (/SUBSYSTEM:WINDOWS)" or 
  "Console (/SUBSYSTEM:CONSOLE)" but neither one worked. Can anyone help !!..BIG THANKS</p>