|
From: Edmund Ng <edm...@sc...> - 2000-11-24 16:43:50
|
Hi folks, I am trying to compile the excel dll (cdll.c) provided by Mumit. I am compiling the file on Solaris using a cross compiler, which from what I understand should create a dll that loads into excel. I've tried creating simple programs on the Solaris that run on NT so I believe that the cross compiler is functional. I used the following makefile, which is just a slight modification of what Mumit had in the Makefile.nocygwin: # # Makefile for Cygwin in -mno-cygwin mode. This builds a DLL that is # independent of Cygwin DLL and only depends on MS CRTDLL runtime. # # If you want to use Mingw32 gcc, then use the makeit.bat file instead. # CC = i386-mingw32-gcc # The root directory for mingw-extra package. You can get this package # from the same place where you downloaded egcs-1.1.2-cygb20 from. # You should also read the -mno-cygwin howto available from: # http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ # # MINGW_EXTRA_ROOT = /usr/local/mingw-extra # MINGW_INCLUDES = -I$(MINGW_EXTRA_ROOT)/include # MINGW_LIBDIRS = -I$(MINGW_EXTRA_ROOT)/lib DEBUG = -g -O2 # The -mrtd flag tells the compiler to use the PASCAL or "stdcall" calling # convention required by VBA/Excel/etc. CFLAGS = -mrtd $(DEBUG) CPPFLAGS = $(MINGW_INCLUDES) AS = i386-mingw32-as DLLTOOL = i386-mingw32-dlltool DLLWRAP = i386-mingw32-dllwrap # # Various targets to build. # DLL_NAME = cdll.dll DLL_EXP_DEF = cdll.def all: $(DLL_NAME) # # sources, objects, etc. # SRCS = $(wildcard *.c) OBJS := $(OBJS:.c=.o) # # DLL related variables. These are used when building the DLL. See later. # # any special flags that you need to pass to the F77 compiler when building # the DLL. (lots of software need _DLL defined). DLL_CFLAGS = -DBUILDING_DLL=1 # This is where you pass linker flags, such as library search path, alternate # entry point, etc. The -s flag strips the final DLL. DLL_LDFLAGS = -s # any extra libraries that your DLL may depend on. DLL_LDLIBS = # # your sources etc that go into the DLL. # DLL_SRCS = cdll.c DLL_OBJS = cdll.o ### # # Making DLL # ### # # Note that we let dllwrap create both the DEF and IMPORT library in # one shot. No need to run dlltool anymore. # DLLWRAP_FLAGS = --export-all --output-def $(DLL_EXP_DEF) \ --target=i386-mingw32 --driver-name $(CC) $(DLL_NAME) $(DLL_EXP_DEF): $(DLL_OBJS) $(DLLWRAP) $(DLLWRAP_FLAGS) -o $(DLL_NAME) \ $(DLL_OBJS) $(DLL_LDFLAGS) $(DLL_LDLIBS) # # dependencies. # fdll.o: fdll.c # # default rules for building DLL objects. Note that client programs (ie., # the ones that *use* the DLL) have to be compiled without the DLL_CFLAGS # flags. # .c.o: $(CC) -c $(CPPFLAGS) $(DLL_CFLAGS) $(CFLAGS) -o $@ $< clean: -rm -f $(OBJS) $(DLL_OBJS) $(DLL_NAME) $(DLL_EXP_DEF) but when I compile the program, I get the following problem: % make i386-mingw32-dllwrap --export-all --output-def cdll.def --target=i386-mingw32 --driver-name i386-mingw32-gcc -o cdll.dll \ cdll.o -s i386-mingw32-dllwrap: no export definition file provided i386-mingw32-dllwrap: creating one, but that may not be what you want Cannot reallocate 2030043136 bytes make: *** [cdll.dll] Error 1 I'm stumped. Isn't dllwrap supposed to create the cdll.def file by calling dlltool? And what is the deal with the cannot reallocate bytes statement? Thanx in advance, Edmund |