title: C++ Linking error within projects having different character set
body: <p>I am having linking error while compiling my C++ project Solution in VS 2005. Following is the scenario.</p>
  
  <p>I have a solutions lets say <code>MySolution</code> within which there are 2 projects named</p>
  
  <p><code>MyTestLib</code> is a Static Library type project with Character Set <code>Use Multi-Byte Character Set</code> and with no <code>CLR</code> support</p>
  
  <p>and</p>
  
  <p><code>MyTestApp</code> is a .exe app using the above lib with Character Set <code>Use Unicode Character Set</code> and with <code>CLR</code> support</p>
  
  <p>in <code>MyTestLib</code> there are two overloaded functions with following definitions</p>
  
  <pre><code>int Class1::test1(int a)
  {
      return a+4; 
  }
  
  bool Class1::test1(LPCTSTR param)
  {
      return true;
  }
  </code></pre>
  
  <p><code>MyTestApp</code> is calling them from its code like</p>
  
  <pre><code>Class1 objcl1;
  int a = objcl1.test1(12); //Works fine
  
  Class1 objcl2;
  string abc = "adsad";
  bool t = objcl2.test1(abc.c_str()); //Error
  </code></pre>
  
  <p>calling the <code>test1(LPCTSTR)</code> version gives error </p>
  
  <p><code>Error  1   error C2664: 'int TestLib::Class1::test1(int)' : cannot convert parameter 1 from 'const char *' to 'int'</code> </p>
  
  <p>if I change the statement as <code>bool t = objcl2.test1((LPCTSTR)abc.c_str()); //Now linking Error</code>
  Then I get</p>
  
  <p><code>Error  2   error LNK2001: unresolved external symbol "public: bool __thiscall TestLib::Class1::test1(wchar_t const *)" (?test1@Class1@TestLib@@$$FQAE_NPB_W@Z) TestProject.obj
  </code></p>
  
  <p>but if I change the project <code>MyTestApp</code> Character Set to <code>Use Multi-Byte Character Set</code> then all the errors are resolved. But I can't change the project Character Set, as there are other dependencies.</p>
  
  <p>Is there any work arround?</p>