Projekt über mehrere Dateien: Viele Linker-Errors
-
Hallo C-Experten!
Ich bin dabei ein Projekt was ehemals in einer einzigen Sourcedatei geschrieben war auf mehrere Dateien zur besseren Übersicht zu verteilen. Die Dateien habe ich mittlerweile soweit, dass sie ordentlich compiliert werden. Wenn das Projekt nun gelinkt werden soll bekomme ich allerdings viele Fehlermeldungen, z.B.:
Error: Undefined symbol __stklen in module c0.ASM Error: Undefined symbol __nfile in module c0.ASM Error: Undefined symbol _exit in module c0.ASM Error: Undefined symbol __exit in module c0.ASM Error: Undefined symbol _gotoxy in module affi.c Error: Undefined symbol _clrscr in module affi.c Error: Undefined symbol _printf in module affi.c usw.
Die ersten 4 Fehler kann ich überhaupt nicht zuordnen, die nächsten 3 sind Funktionen, die über eine Headerdatei eingebunden werden.
Kann es sein, dass mein makefile vielleicht was falsch macht??
# autodependency checking .AUTODEPEND # *Translator Definitions* CC = tcc +AFFI.CFG TASM = TASM TLIB = tlib TLINK = tlink LIBPATH = C:\TC\LIB INCLUDEPATH = C:\TC\INCLUDE # *Implicit Rules* {$<}= path+filename .c.obj: $(CC) -c {$< } # *List Macros* EXE_dependencies = affi.obj menu.obj base.obj dolphin.obj $(LIBPATH)\dolphinl.lib # *Explicit Rules* affi.exe: affi.cfg $(EXE_dependencies) $(TLINK) /v/x/c/L$(LIBPATH) @&&| c0l.obj+ affi.obj+ menu.obj+ base.obj+ dolphin.obj affi # no map file $(LIBPATH)\dolphinl.lib+ emu.lib+ mathl.lib+ cl.lib | # *Individual File Dependencies* affi.obj: affi.cfg affi.c menu.obj: affi.cfg menu.c base.obj: affi.cfg base.c dolphin.obj: affi.cfg $(INCLUDEPATH)\dolphin.h $(CC) -c $(INCLUDEPATH)\dolphin.h # *Compiler Configuration File* # Kommandozeilenargumente nach affi.cfg kopieren affi.cfg: makefile copy &&| -ml -v -vi- -w-ret -w-nci -w-inl -wpin -wamb -wamp -w-par -wasm -wcln -w-cpt -wdef -w-dup -w-pia -wsig -wnod -w-ill -w-sus -wstv -wucp -wuse -w-ext -w-ias -w-ibc -w-pre -w-nst -I$(INCLUDEPATH) -L$(LIBPATH) | affi.cfg
Es handelt sich um einen Borland Turbo C Compiler und auch um ein Borland make...
Wäre super, wenn mir jemand helfen kann!!
-
Wie schon leicht vermutet lags am makefile, da das Borland Make auch nicht gerade super im Web dokumentiert ist hats etwas länger gedauert....
So gehts:
.AUTODEPEND # *Translator Definitions* CC = tcc +SIMPLE.CFG TASM = TASM TLIB = tlib TLINK = tlink LIBPATH = C:\TC\LIB INCLUDEPATH = C:\TC\INCLUDE # *Implicit Rules* .c.obj: $(CC) -c {$< } .cpp.obj: $(CC) -c {$< } # *List Macros* EXE_dependencies = \ $(LIBPATH)\dolphinl.lib \ menu.obj \ base.obj \ affi.obj # *Explicit Rules* affi.exe: affi.cfg $(EXE_dependencies) $(TLINK) /v/x/c/L$(LIBPATH) @&&| c0l.obj+ menu.obj+ base.obj+ affi.obj affi # no map file $(LIBPATH)\dolphinl.lib+ emu.lib+ mathl.lib+ cl.lib | # *Individual File Dependencies* affi.obj: affi.cfg affi.c menu.obj: affi.cfg menu.c base.obj: affi.cfg base.c # *Compiler Configuration File* affi.cfg: makefile copy &&| -ml -v -vi- -w-ret -w-nci -w-inl -wpin -wamb -wamp -w-par -wasm -wcln -w-cpt -wdef -w-dup -w-pia -wsig -wnod -w-ill -w-sus -wstv -wucp -wuse -w-ext -w-ias -w-ibc -w-pre -w-nst -I$(INCLUDEPATH) -L$(LIBPATH) | simple.cfg