Using VC2005, I have 3 projects to build:
- libA (contains a typelib, results in libA.dll): IDL has a line
library libA { ... - libB (contains a typelib importing libA, results in libB.dll): IDL has a line
importlib( 'libA ' ); - libC (imports libB): one of the source files contains
#import <libB.dll>
the #import <libB.dll> is handled by the compiler in the following way (according to documentation):
- search directories of %PATH%
- search directories of %LIB%
- search the ‘additional include paths’ (/I compiler option)
When compiling libC, I can see that cl.exe clearly is able to find the libA.dll on the executable path (using Filemon.exe)
VC error C4772: #import of typelib with another dependency
However, still the libA namespace is not found and all references to libA types are replaced by __missing_type__
(edit) Meanwhile, I found out the problem only appears when using the debug dlls.
Anyone seen this problem before? And solved it?
Finally Found It!
In the Visual Studio project, the A.idl file in LibA had the MkTypeLib Compatible setting ON. This overruled the behaviour inherited from the A project. To make things worse, it was only ON in the Debug configuration.
The consequence was that for every
This resulted in the
tagEnot being defined in the resulting typelib. When LibB did it’simport( 'A.dll' ), all references totagEwere replaced with__missing_type__…