Share via


error C4772: #import referenced a type from a missing type library; '__missing_type__' used as a placeholder

Question

Tuesday, February 18, 2014 9:46 PM

Hiii

I am migrating my application from vc++6.0 to vc++2008

I am getting this error C4772 in one of the header file , Below is the code line:

// define same types to be used in ICusomImportImpl.h out of the namespace!
#import "../Policy1/Policy1.tlb" rename_namespace("Policy1") raw_interfaces_only, raw_native_types, named_guids  //error
using Policy1::IBusinessImport;
using Policy1::IBusinessImportHelpers;

This error is referencing towards Policy1.tlb, but when i checked this tlb file is being  created  in right path.

Can anyone suggest me the solution for this??

Thanks

All replies (2)

Friday, February 21, 2014 12:06 PM âś…Answered

Hi Sunny,

We used rebuild the project after cleaning, but when I tried to build the project without a clean, then the above error went off. Weird but just want to say that this issue is now resolved.

Thanks for your help!

Regards,

Ankush.


Thursday, February 20, 2014 2:09 AM | 1 vote

Hi,

According to your description, I suggest you put all the .tlb files to the project directory and rebuild your project. It may help you solve the problem.

A type library was referenced with the #import directive. However, the type library contained a reference to another type library that was not referenced with #import. This other .tlb file was not found by the compiler.

Note that the compiler will not find type libraries in different directories if you use the /I (Additional Include Directories) compiler option to specify those directories. If you want the compiler to find type libraries in different directories, add those directories to the PATH environment variable.

Also, I suggest you read this document:

http://msdn.microsoft.com/en-us/library/sce74ah7(v=vs.90).aspx

It includes a sample which will generate error C4772.

Best regards,

Sunny