nmake on proxy/stub results in unresolved externals 
Author Message
 nmake on proxy/stub results in unresolved externals

Hi,

Here's the scenario: I have a IMyBase defined in \base\base.idl and
interface IMyDerived : IMyBase defined in \derived\derived.idl. Also I
import base.idl in derived.idl.

base.idl builds properly and nmake on baseps.mk builds correctly.
derived.idl also builds properly but nmake on derivedps.mk results in an
unresolved external linker error:

Creating library derivedps.lib and object derivedps.exp
derived_p.obj : error LNK2001: unresolved external symbol _IID_IMyBase
DERIVED.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460' Stop.

I've noticed that IID_IMyBase is referenced in derived_p.c but not actually
externed.
In derived_p.c #includes derived.h which in turn #includes base.h where
there is: EXTERN_C const IID IID_IMyBase.

Hope that's not too confusing, many thanks in advance,
Babak.



Mon, 08 Aug 2005 05:59:37 GMT  
 nmake on proxy/stub results in unresolved externals
You probably need to link with base_i.c file generated from base.idl.
Open the .mk file and add base_i.* wherever derived_i.* is mentioned.
Should be fairly obvious.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Hi,

> Here's the scenario: I have a IMyBase defined in \base\base.idl and
> interface IMyDerived : IMyBase defined in \derived\derived.idl. Also I
> import base.idl in derived.idl.

> base.idl builds properly and nmake on baseps.mk builds correctly.
> derived.idl also builds properly but nmake on derivedps.mk results in
an
> unresolved external linker error:

> Creating library derivedps.lib and object derivedps.exp
> derived_p.obj : error LNK2001: unresolved external symbol _IID_IMyBase
> DERIVED.dll : fatal error LNK1120: 1 unresolved externals
> NMAKE : fatal error U1077: 'link' : return code '0x460' Stop.

> I've noticed that IID_IMyBase is referenced in derived_p.c but not
actually
> externed.
> In derived_p.c #includes derived.h which in turn #includes base.h
where
> there is: EXTERN_C const IID IID_IMyBase.

> Hope that's not too confusing, many thanks in advance,
> Babak.



Mon, 08 Aug 2005 06:15:56 GMT  
 nmake on proxy/stub results in unresolved externals
Also, it might make more sense to build a single proxy/stub DLL for
all related interfaces (perhaps there are others...). Copy all IDL files
in a single folder, MIDL them there, then write a makefile that includes
all generated _i.c and _p.c (plus dlldata.c) files and build with it.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> You probably need to link with base_i.c file generated from base.idl.
> Open the .mk file and add base_i.* wherever derived_i.* is mentioned.
> Should be fairly obvious.
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



> > Hi,

> > Here's the scenario: I have a IMyBase defined in \base\base.idl and
> > interface IMyDerived : IMyBase defined in \derived\derived.idl. Also I
> > import base.idl in derived.idl.

> > base.idl builds properly and nmake on baseps.mk builds correctly.
> > derived.idl also builds properly but nmake on derivedps.mk results in
> an
> > unresolved external linker error:

> > Creating library derivedps.lib and object derivedps.exp
> > derived_p.obj : error LNK2001: unresolved external symbol _IID_IMyBase
> > DERIVED.dll : fatal error LNK1120: 1 unresolved externals
> > NMAKE : fatal error U1077: 'link' : return code '0x460' Stop.

> > I've noticed that IID_IMyBase is referenced in derived_p.c but not
> actually
> > externed.
> > In derived_p.c #includes derived.h which in turn #includes base.h
> where
> > there is: EXTERN_C const IID IID_IMyBase.

> > Hope that's not too confusing, many thanks in advance,
> > Babak.



Mon, 08 Aug 2005 07:51:53 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. unresolved external "_main" in proxy/stub

2. COM proxies and stubs in C#

3. Proxy Stub Problem with Visual C++ 7

4. Merge Proxy/stub (in ATL) generated DLL does not change the Proxystubclsid32

5. Proxy Stub Dll

6. poblem in making proxy stub DLL from *.mk file

7. IDL problem : setting Interface inside or outside typelib / Proxy stub vs Aggregation

8. ATL COM DLL without proxy/stub

9. proxy/stub usage

10. Proxy Stub

11. How to generate the proxy/stub with VC.NET

12. Registering proxy/stub for Side by Side COM Components

 

 
Powered by phpBB® Forum Software