title: Linking error LNK2001: unresolved external symbol (Visual Studio 2008)
body: <p>I have 3 linking errors where I cannot get rid off.</p>
  
  <p>I have defined some static public class constants of an own user-defined type in the header file of the class. Next I have declared and initialized the class constant in the cpp file. I can use these constants in the class itself. When I however try to use the constants in another project, I get a linking error:</p>
  
  <pre><code>error LNK2001: unresolved external symbol "public: static class EFString const CEFMldEreignis::s_typeMelderSteuern"
  </code></pre>
  
  <p>I have no idea what's wrong here. Someone an idea?</p>
  
  <p>Many thanks in advance!</p>
  
  <p><strong>Header file</strong>:</p>
  
  <pre><code>class LIB_EXPORT CEFMldEreignis : public CBusinessObjekt
  {
      ...
  
  public:
      static const EFString s_typeMelderSteuern;
  
      ...
  };
  </code></pre>
  
  <p><strong>cpp file</strong>:</p>
  
  <pre><code>#include "EFMldEreignis.h"
  
  const EFString CEFMldEreignis::s_typeMelderSteuern = _T("S");
  </code></pre>
  
  <p>We are using Visual Studio 2008.
  The project where the constants are defined is added as a reference in the <em>common properties</em> of the other project, as well as an additional include directory in the <em>C++ properties</em>.</p>
  
  <p>In another, third project, we are actually declaring some static class constants as well, and these ones give no linking errors when using them.</p>
  
  <p><strong>Linker command line (all options)</strong>:</p>
  
  <p><em>(Remark: EuroAllgemeineMasken is the "other" project where the constants are used; EuroMelder is the project where the constants are defined and declared.)</em></p>
  
  <pre><code>/OUT:"C:\Eldis3\trunk\ELDIS\Workspace\..\Debug\EuroAllgemeineMasken.dll" /INCREMENTAL     
  /NOLOGO /LIBPATH:"C:\Eldis3\trunk\ELDIS\Workspace\..\Debug" 
  /LIBPATH:"C:\Eldis3\trunk\ELDIS\Workspace\\..\..\Lib\External\SST" 
  /LIBPATH:"C:\Eldis3\trunk\ELDIS\Workspace\\..\..\Lib\External\ELDIS" /DLL /MANIFEST 
  /MANIFESTFILE:"Debug\EuroAllgemeineMasken.dll.intermediate.manifest" 
  /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /
  PDB:"C:\Eldis3\trunk\ELDIS\Workspace\..\Debug\EuroAllgemeineMasken.pdb" 
  /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO     
  /IMPLIB:"C:\Eldis3\trunk\ELDIS\Workspace\..\Debug\EuroAllgemeineMasken.lib" /MACHINE:X86 
  /ERRORREPORT:PROMPT ..\..\ELDIS\Debug\CEDVToolsEldis.lib ..\..\ELDIS\Debug\EuroTetra.lib 
  ..\..\ELDIS\Debug\Services.lib ..\..\ELDIS\Debug\ServiceManager.lib 
  ..\..\ELDIS\Debug\CESocketUDP.lib ..\..\ELDIS\Debug\EuroLWZ.lib 
  ..\..\ELDIS\Debug\EuroRouting.lib ..\..\ELDIS\Debug\MassnahmeTools.lib 
  ..\..\ELDIS\Debug\EuroDispo.lib ..\..\ELDIS\Debug\EuroMass.lib 
  ..\..\ELDIS\Debug\BCGControlBar.lib ..\..\ELDIS\Debug\EuroFlug.lib 
  ..\..\ELDIS\Debug\EuroMFCTools.lib ..\..\ELDIS\Debug\EuroLog.lib 
  ..\..\ELDIS\Debug\EuroGis.lib ..\..\ELDIS\Debug\EuroDialoge.lib 
  ..\..\ELDIS\Debug\CECrystalReport.lib ..\..\ELDIS\Debug\EuroInfo.lib 
  ..\..\ELDIS\Debug\EuroIO.lib ..\..\ELDIS\Debug\EuroPers.lib 
  ..\..\ELDIS\Debug\EuroStatus.lib ..\..\ELDIS\Debug\CELTextEldis.lib 
  ..\..\ELDIS\Debug\EuroBers.lib ..\..\ELDIS\Debug\EuroMelder.lib 
  ..\..\ELDIS\Debug\EuroLeit.lib ..\..\ELDIS\Debug\LOVDialog.lib 
  ..\..\ELDIS\Debug\EuroFunk.lib ..\..\ELDIS\Debug\EuroEsta.lib 
  ..\..\ELDIS\Debug\EuroOrt.lib ..\..\ELDIS\Debug\EuroEinsatz.lib 
  ..\..\ELDIS\Debug\Gms.lib ..\..\ELDIS\Debug\GMTs.lib ..\..\ELDIS\Debug\EuroAdmin.lib 
  ..\..\ELDIS\Debug\EuroOber.lib ..\..\ELDIS\Debug\EFBusiness.lib 
  ..\..\ELDIS\Debug\EuroTools.lib ..\..\ELDIS\Debug\DBAccess.lib 
  ..\..\ELDIS\Debug\DynamicWindows.lib
  </code></pre>