www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - link problems with com samples

reply "aelmetwaly" <aelmetwaly gawab.com> writes:
I tried to compile the com sample but I get the following link errors
although I link with ws2_32.lib

Why these link errors?!!



//////////////////////////////////////

With file dserver.d

/////////////////////////////////////



OPTLINK (R) for Win32  Release 7.50B1

Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved



dserver.obj(dserver)

 Error 42: Symbol Undefined _IID_IUnknown

dserver.obj(dserver)

 Error 42: Symbol Undefined _IID_IClassFactory



--- errorlevel 2



/////////////////////////////////////

And the following link errors with chello.obj

////////////////////////////////////



OPTLINK (R) for Win32  Release 7.50B1

Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved



chello.obj(chello)

 Error 42: Symbol Undefined _IID_IUnknown

chello.obj(chello)

 Error 42: Symbol Undefined __D3std1c7windows3com9ComObject6AddRefWZk 0

chello.obj(chello)

 Error 42: Symbol Undefined _D6object6Object8opEqualsFC6ObjectZi

chello.obj(chello)

 Error 42: Symbol Undefined _D6object6Object5opCmpFC6ObjectZi

chello.obj(chello)

 Error 42: Symbol Undefined _D6object6Object6toHashFZk

chello.obj(chello)

 Error 42: Symbol Undefined _D6object6Object8toStringFZAa

chello.obj(chello)

 Error 42: Symbol Undefined _D6object6Object5printFZv

chello.obj(chello)

 Error 42: Symbol Undefined __Class_3std1c7windows3com9ComObject

chello.obj(chello)

 Error 42: Symbol Undefined __vtbl_9ClassInfo

chello.obj(chello)

 Error 42: Symbol Undefined __Interface_3std1c7windows3com8IUnknown

OPTLINK : Warning 134: No Start Address



--- errorlevel 10



////////////////////////////////

And these with dclient.d

////////////////////////////////



c:\dlang\dm\bin\..\lib\phobos.lib(dmain2)

 Error 42: Symbol Undefined _CoInitialize 4

c:\dlang\dm\bin\..\lib\phobos.lib(dmain2)

 Error 42: Symbol Undefined _CoFreeLibrary 4

c:\dlang\dm\bin\..\lib\phobos.lib(dmain2)

 Error 42: Symbol Undefined _CoUninitialize 0

c:\dlang\dm\bin\..\lib\phobos.lib(dmain2)

 Error 42: Symbol Undefined _CoBuildVersion 0

c:\dlang\dm\bin\..\lib\phobos.lib(dmain2)

 Error 42: Symbol Undefined _CoCreateInstance 20

c:\dlang\dm\bin\..\lib\phobos.lib(dmain2)

 Error 42: Symbol Undefined _CoFreeUnusedLibraries 0

c:\dlang\dm\bin\..\lib\phobos.lib(com)

 Error 42: Symbol Undefined _IID_IUnknown



--- errorlevel 7





"Walter" <newshound digitalmars.com> wrote in message
news:<cgqio7$20p$2 digitaldaemon.com>...

 Check out the COM example (dclient.d and dserver.d) in \dmd\samples\d,
 that should be helpful.


Aug 29 2004
parent J C Calvarese <jcc7 cox.net> writes:
aelmetwaly wrote:
 I tried to compile the com sample but I get the following link errors
 although I link with ws2_32.lib
If you look at the all.sh file, it gives some hints: $(DMD) -c dserver -release $(DFLAGS) $(DMD) -c chello $(DFLAGS) $(DMD) dserver.obj chello.obj uuid.lib ole32.lib advapi32.lib kernel32.lib user32.lib dserver.def -L/map $(DMD) dclient $(DFLAGS) ole32.lib uuid.lib It looks like the server example needs uuid.lib, ole32.lib, advapi32.lib kernel32.lib, and user32.lib. The client seems to need ole32.lib and uuid.lib. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Aug 29 2004