title: Linker error while trying to use assembler code in cpp module
body: <p>I'm using visual studio 2013 and trying to run simple nasm code.</p>
  
  <p>main.cpp:</p>
  
  <pre><code>#include "Header.h"
  void _printf() {
      printf("HELLO\n");
  }
  
  int main()
  {
      sayHello();
      return 0;
  }
  </code></pre>
  
  <p>Header.h:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void _printf();
  
  extern "C" {
      void sayHello();
  }
  </code></pre>
  
  <p>and asm file hello.asm:</p>
  
  <pre><code>SECTION .text
  
  EXTERN _printf
  
  global sayHello
  sayHello:
      push ebx
      call _printf
      pop ebx
  ret
  </code></pre>
  
  <p>after that I get the following error:</p>
  
  <pre><code>Error   1   error LNK2019: unresolved external symbol _sayHello referenced in function _main    c:\Users\art.mhtr\documents\visual studio 2013\Projects\ConsoleApplication8\ConsoleApplication8\main.obj    ConsoleApplication8
  </code></pre>