I have a c++ project that is importing two .tlbs in a header file.
#import "..\bin\derived.tlb" named_guids raw_interfaces_only
#import "..\bin\base.tlb" named_guids raw_interfaces_only
Now derived.tlb
is dependent on base.tlb. There are base classes in base.tlb
that classes in derived.tlb
are based on.
When I compile, I get
"fatal error c1084: cannot read type library file '..\derived.tlb': Error loading type library/DLL."
Now it's complaining about derived.tlb
but the problem seems to really be in not being able to find base.tlb
.
base.tlb
comes from a C# Com interop
project. If I check the "register for com interop" in the build tab of the c# project, this problem goes away in the c++ project. But I don't want to register it. This gets built on a build machine which shouldn't have anything registered on it. So I create the .tlb
with a post build step to tlbexport
.
The tlb
gets created in the correct folder but it appears that without the registration, #import
can't find the base.tlb
when importing derived.tlb
.
I see in process monitor, it's trying a hell of a lot of places to find base.tlb
but not the correct folder that equates to ..\bin\
.
What can I do to get it searching in the right place? Adding an entry for it in "Additional Include Directories" in the c++ project doesn't seem to help.