Programming

Visual Studio 2015 Update 3 Error C4772

Having just switched from Visual Studio 2015 Update 1 to Update 3 and updated our compiler from Intel Composer 2016.2 to 2017.1 we got an error C4772:

C++ Error C4772: #import referenced a type from a missing type library; ‘__missing_type__’ used as a placeholder

The code included two type libraries Common and Logger, the Logger library had a dependency on the Common type library. Previously this worked fine but it seems a change in Visual Studio 2015 or Intel Composer 2017 have broken this.

#import "..\tlb\Common.tlb"
#import "..\tlb\Logger.tlb"

If the code was changed to the following then the error disappeared:

#import "..\tlb\Common.tlb" no_registry
#import "..\tlb\Logger.tlb" no_registry

Unfortunately this only worked fine with the Microsoft compiler, with the Intel compiler we got an error C1108. For now this small import project can just be switched to MS compiler only, but it would seem that the reason for the error below is because when switching to the Intel compiler it adds ‘$(MSBuild_ExecutablePath)’ to the Exclude Directories, of which it includes ‘C:\windows\Microsoft.NET\Framework\v4.0.30319\’ which is where TLBREF.dll lives.

c:\program files (x86)\microsoft visual studio 14.0\vc\include\comdef.h: : error C1108: unable to find DLL: ‘TLBREF.dll’

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.