www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - COM sample doesn't compiled with dmd v0.94

reply David L. Davis <SpottedTiger yahoo.com> writes:
I've been trying to build the sample COM client program and the Server DLL from
"C:\dmd\samples\d\" source chello.d and dserver.d (which I placed in my dmd
directory to change once I saw that they compiled and worked) using dmd v0.94,
but without any luck. After correcting the aging source code...lines 49,378
changed from .size to .sizeof, and lines 250 and 294 from "C" style casts to "D"
style casts, I'm now getting the following "Linker Errors."  

<Linker_Error>

C:\dmd>bin\dmd dserver.d chello.d
C:\dmd\bin\..\..\dm\bin\link.exe dserver+chello,,,user32+kernel32/noi;
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

</Linker_Error>

I found that both IID_IUnknown and IID_IClassFactory are well defined in
"C:\dmd\src\phobos\std\c\windows\com.d", so I'm unsure what exactly is wrong,
could someone point out how to fix this...or maybe give a good working example
of code for building a .OCX (COM/ActiveX) type Windows' DLL. 

Thxs in Advance! :)

-------------------------------------------------------------------
"Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"
Jun 28 2004
parent reply J C Calvarese <jcc7 cox.net> writes:
In article <cbpk1b$1i4l$1 digitaldaemon.com>, David L. Davis says...
I've been trying to build the sample COM client program and the Server DLL from
"C:\dmd\samples\d\" source chello.d and dserver.d (which I placed in my dmd
directory to change once I saw that they compiled and worked) using dmd v0.94,
but without any luck. After correcting the aging source code...lines 49,378
changed from .size to .sizeof, and lines 250 and 294 from "C" style casts to "D"
style casts, I'm now getting the following "Linker Errors."  

<Linker_Error>

C:\dmd>bin\dmd dserver.d chello.d
C:\dmd\bin\..\..\dm\bin\link.exe dserver+chello,,,user32+kernel32/noi;
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

I haven't upgraded to DMD 0.94 here at work yet, but there should be hints in the all.sh file: # COM client/server example $(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'll probably work if you compile like this (all one line): C:\dmd>bin\dmd dserver.d chello.d uuid.lib ole32.lib advapi32.lib kernel32.lib user32.lib dserver.def -L/map Good luck.
</Linker_Error>

I found that both IID_IUnknown and IID_IClassFactory are well defined in
"C:\dmd\src\phobos\std\c\windows\com.d", so I'm unsure what exactly is wrong,
could someone point out how to fix this...or maybe give a good working example
of code for building a .OCX (COM/ActiveX) type Windows' DLL. 

Thxs in Advance! :)

-------------------------------------------------------------------
"Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"

jcc7
Jun 28 2004
parent reply David L. Davis <SpottedTiger yahoo.com> writes:
In article <cbpm3d$1ktb$1 digitaldaemon.com>, J C Calvarese says...
I haven't upgraded to DMD 0.94 here at work yet, but there should be hints in
the all.sh file:

# COM client/server example

$(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'll probably work if you compile like this (all one line):
C:\dmd>bin\dmd dserver.d chello.d uuid.lib ole32.lib advapi32.lib kernel32.lib
user32.lib dserver.def -L/map

Good luck.

J C Calvarese: Thxs for making me aware of the .sh file! :) With the following errors fixed, they all compiled with dmd v0.94 and ran: C:\dmd\samples\d>..\..\bin\shell.exe all.sh dserver.d : lines 49 and 378 changed from .size to .sizeof, plus lines 250 and 294 from "C" style casts to "D" style casts dhry.d : lines 445 and 446 .changed from .size to .sizeof Is there someone I should sent this list do, or should I put this information in the D.Bug section...do get these errors fixed before the next version of dmd is build? David ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"
Jun 28 2004
parent J C Calvarese <jcc7 cox.net> writes:
David L. Davis wrote:
 In article <cbpm3d$1ktb$1 digitaldaemon.com>, J C Calvarese says...
 
I haven't upgraded to DMD 0.94 here at work yet, but there should be hints in
the all.sh file:

# COM client/server example

$(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'll probably work if you compile like this (all one line):
C:\dmd>bin\dmd dserver.d chello.d uuid.lib ole32.lib advapi32.lib kernel32.lib
user32.lib dserver.def -L/map

Good luck.

J C Calvarese: Thxs for making me aware of the .sh file! :) With the following errors fixed, they all compiled with dmd v0.94 and ran: C:\dmd\samples\d>..\..\bin\shell.exe all.sh dserver.d : lines 49 and 378 changed from .size to .sizeof, plus lines 250 and 294 from "C" style casts to "D" style casts dhry.d : lines 445 and 446 .changed from .size to .sizeof Is there someone I should sent this list do, or should I put this information in the D.Bug section...do get these errors fixed before the next version of dmd is build?

Well, there are already a few posts in the bugs newsgroup about C-style casts in the example files, but I guess we haven't gotten Walter's attention yet. I'd suggest that if we mention this again in the bugs newsgroup that we reply to the existing threads rather than start new ones. digitalmars.D.bugs/393 digitalmars.D.bugs/412 (crossposted as digitalmars.D/3416)
 
 David
 
 -------------------------------------------------------------------
 "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"

-- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Jun 28 2004