Compiler Warning (level 4) C4336
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Compiler Warning (level 4) C4336

Error Message

import cross-referenced type library 'type_lib1' before importing 'type_lib1'

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 found by the compiler.

Given two type libraries on disk created from the following two files (compiled with midl.exe):

// c4336a.idl
library c4336aLib
   enum E_C4336
      one, two, three

The second type library:

// c4336b.idl
library C4336bLib
   importlib ("c4336a.tlb");
   struct S_C4336
      enum E_C4336 e;

The following sample generates C4336:

// C4336.cpp
// compile with: /W4 /LD
// #import "C4336a.tlb"
#import "C4336b.tlb"   // C4336, uncomment previous line to resolve
© 2016 Microsoft