This documentation is archived and is not being maintained.

Compiler Warning (level 4) C4337

Error Message

cross-referenced type library 'typelib1' in 'typelib2' is being automatically imported

The auto_search attribute of the #import directive caused a type library to be implicitly imported.

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

// C4337a.idl
library C4337aLib
   enum E_C4337a
      one = 0,
      two = 1,
      three = 2

and then the second .idl file,

// C4337b.idl

library C4337bLib

   struct S_C4337b
      enum E_C4337a e;

The following sample generates C4337:

// C4337.cpp
// compile with: /W4 /LD
#import "c4337b.tlb" auto_search   // C4337
// explicitly #import all type libraries to resolve
// #import "C4337a.tlb"
// #import "C4337b.tlb"