title: Native/Mixed-mode dll linking error in vs2010
body: <p>I am trying to understand how native code can interact with .NET code and am basically trying to implement the example in the answer to this <a href="https://stackoverflow.com/questions/1823466/how-to-call-a-net-dll-from-a-win32-process">topic</a>. The example code has two parts, one that goes into a .dll compiled with the /clr option:</p>
  
  <pre><code>__declspec(dllexport) bool toUpper(void)
  {
      return true;
  }
  </code></pre>
  
  <p>and the code that is supposed to call this function goes into a win32 application, which is compiled natively:</p>
  
  <pre><code>bool toUpper(void);
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      bool b = toUpper();
      return 0;
  }
  </code></pre>
  
  <p>However vs2010 gives the following linker error:</p>
  
  <blockquote>
    <p>error LNK2019: unresolved external
    symbol "bool __cdecl toUpper(void)"
    (?toUpper@@YA_NXZ) referenced in
    function _wmain</p>
  </blockquote>
  
  <p>As soon as I turn off the /clr option on the dll project, everything works, so I assume that I have all the dependencies between the projects set up correctly. Any suggestions on what I did wrong?</p>