From: Rosen G. <ros...@ya...> - 2002-08-02 22:03:57
|
I have two problem while linking a DLL file. 1. C object files can't access functions in C++ object files I get error like : gpu.o(.text+0x239):gpu.c: undefined reference to `InitDraw' 'InitDraw' is declered in a cpp file But when i rename all the *.c files to *.cpp so they compile with the C++ syntax this is no longer a problem. But then i have the next problem : 2. All the export functions declared in the DEF file give errors like this one: gpup.exp(.edata+0x34):fake: undefined reference to `GPUconfigure' And in the file i have a function long CALLBACK GPUconfigure() { return 0; } # ========== The makefile looks like (if he could be the reason) PROJECT = gpup.dll DEF_FILE = gpup.def GCC = gcc DLLWRAP = dllwrap CFLAGS = -Ic:\dx7sdk\include -fvtable-thunks -c -mwindows -O3 LDFLAGS = -Lc:\dx7sdk\lib LIBS = -ld3dim -ld3drm -ld3dx -ld3dxd -ld3dxof -lddraw -ldinput \ -ldplayx -ldsetup -ldsound -ldxguid -lwinmm CC = $(GCC) $(CFLAGS) OBJS_CPP = gpu.o gpucmnds.o draw.o OBJS_C = OBJS = $(OBJS_CPP) $(OBJS_C) $(PROJECT) : $(OBJS) $(DLLWRAP) $(LDFLAGS) $(OBJS) --dllname $(PROJECT) -def $(DEF_FILE) $(LIBS) $(OBJS_CPP) : %.o : %.cpp $(CC) -o $@ $^ $(OBJS_C) : %.o : %.c $(CC) -o $@ $^ #============ Can someone tell me how to get around this? TNX in advance __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com |