title: fatal error C1084: Cannot read type library file: 'Smegui.tlb': Error loading type library/DLL
body: <p>I am trying to build an old version of an application which consists of VC++ projects that were written in Visual Studio 2003.</p>
  
  <p>My OS is Windows 7 Enterprise (64-bit).
  When I try and build the solution I get the following errors:</p>
  
  <blockquote>
  <ul>
  <li>
  error C4772: #import referenced a type from a missing type library; '__missing_type__' used as a placeholder
  </li>
  <li>
  fatal error C1084: Cannot read type library file: 'Smegui.tlb': Error loading type library/DLL.
  </li>
  </ul>
  </blockquote>
  
  <p>They both complain about the following import statement:</p>
  
  <pre><code>#import "Smegui.tlb" no_implementation
  </code></pre>
  
  <p>This is not a case of the file path being incorrect as renaming the Smegui.tlb file causes the compiler to throw another error saying it cannot find the library.</p>
  
  <p>Smegui is from another application that this one depends on. I thought perhaps I was missing a dll but there is no such thing as Smegui.dll.</p>
  
  <p>All I know about .tlb files is that they are a type library and you can create them from an assembly using tlbexp.exe or regasm.exe (the later also registers the assembly with COM)</p>
  
  <p>There is also an Apache Ant build script which uses a custom task to invoke devenv.com to build the projects. This is the same script that the build server originally used to build the application. It gives me the same errors when I try and run it.</p>
  
  <p>The strangest thing about this is that I knew it ought to work seeing as it is all freshly checked out from subversion. I tried many different combinations of admin vs user elevation, VS vs Ant build, cleaning, release.</p>
  
  <p>I have got it to build successfully about 5 times but the build seems to be non-deterministic.</p>
  
  <p>If anyone can shed some light on how this tlb stuff even works or what this error might mean I would greatly appreciate it.</p>