title: Unresolved external symbol error, even if function is defined and seen by IDE
body: <p>using Visual C++ 2008, I am having an "Unresolved external symbol" even if with the IDE I can correctly see both declaration and definition of the function:</p>
  
  <p>The error:</p>
  
  <pre><code>hook_file.obj : error LNK2001: unresolved external symbol "int __cdecl is_directory_objattr(struct _OBJECT_ATTRIBUTES const *)" (?is_directory_objattr@@YAHPBU_OBJECT_ATTRIBUTES@@@Z)
  </code></pre>
  
  <p>Relevant code in hook_file.cpp:</p>
  
  <pre><code>    #include "misc.h"
  
      void handle_new_file(HANDLE file_handle, const OBJECT_ATTRIBUTES *obj)
          {
              if(is_directory_objattr(obj) == 0 ) { 
              // etc.
  </code></pre>
  
  <p>Declaration in misc.h file:</p>
  
  <pre><code>BOOL is_directory_objattr(const OBJECT_ATTRIBUTES *obj);
  </code></pre>
  
  <p>Definition in misc.cpp file:</p>
  
  <pre><code>#include "misc.h"
  
  BOOL is_directory_objattr(const OBJECT_ATTRIBUTES *obj)
      { //function body here }
  </code></pre>
  
  <p>I really don't get what the linker has to complain here.</p>
  
  <ul>
  <li>The header with function declaration is included by the file which
  calls the function.</li>
  <li>The cpp file with the function definition included header file with declaration.</li>
  <li>Declaration and definitions are identical.</li>
  <li>All files are listed among project files.</li>
  </ul>
  
  <p>Any idea whats wrong?</p>
  
  <p>Thanks!</p>