Don さんは書きました:
On Windows, it compiles, but I can't get it to link. The errors are all
related to malloc-family functions.
------------
rmem.obj(rmem) Offset 00111H Record Type 0091
Error 1: Previous Definition Different : ?str...@mem@@qaepad...@z (char
*syscall Mem::strdup(char const *))
--- and so on for the other Mem functions, all from rmem.obj.
tk.obj(tk)
Error 42: Symbol Undefined ?mem_free@@yax...@z (void cdecl
mem_free(void *))
-- and so on, all the malloc functions from tk.obj.
e2ir.obj(e2ir)
Error 42: Symbol Undefined ?mem_fcalloc@@yap...@z (void *cdecl
mem_fcalloc(unsi
gned ))
cgobj.obj(cgobj)
Error 42: Symbol Undefined ?mem_realloc@@yapaxp...@z (void *cdecl
mem_realloc(v
oid *,unsigned ))
-----------
1. Edit win32.mak like this:
--- win32.mak.default Thu Mar 05 01:53:36 2009
+++ win32.mak Thu Mar 05 23:06:02 2009
@@ -6,6 +6,6 @@
-D=
+D=c:\d
SCROOT=$D\dm
INCLUDE=$(SCROOT)\include
-CC=\dm\bin\dmc
+CC=c:\d\dm\bin\dmc
LIBNT=$(SCROOT)\lib
@@ -14,2 +14,3 @@
CP=cp
+SC=c:\d\dm\bin\sc.exe
@@ -153,3 +154,3 @@
$(TARGET).exe : $(OBJS) win32.mak
- sc -o$(TARGET).exe $(OBJS) -cpp -mn -Ar $(LFLAGS)
+ $(SC) -o$(TARGET).exe $(OBJS) -cpp -mn -Ar $(LFLAGS)
@@ -169,3 +170,3 @@
msgsx.exe : msgsx.c
- sc msgsx -mn -D$(TARGET) $(DEFINES) $(WINLIBS)
+ $(SC) msgsx -mn -D$(TARGET) $(DEFINES) $(WINLIBS)
@@ -173,3 +174,3 @@
$C\cdef.h $C\cc.h $C\oper.h $C\ty.h $C\optabgen.c
- sc -cpp -ooptabgen.exe $C\optabgen -DMARS -I$(TK) $(WINLIBS) #-L$(LINKS)
+ $(SC) -cpp -ooptabgen.exe $C\optabgen -DMARS -I$(TK) $(WINLIBS)
#-L$(LINKS)
optabgen
@@ -181,3 +182,3 @@
id.h id.c : idgen.c
- sc -cpp idgen
+ $(SC) -cpp idgen
idgen
2. Remove old dmd and dmc folders.
3. Extract dmd.zip and dmc.zip.
You got link errors because you over-wrote to old folders.
4. Enjoy your dmd!