Page 1 of 1

ld is giving me errors

Posted: Mon Nov 08, 2004 12:46 am
by forsaken_dragon
I am new to os development, but i am proficient with c++ and asm. When i try to link my cpp .o files with my asm .o file (aout format) using ld i get the following error: File format not recognized. Here is a build.bat file i made to save myself some time:

@echo off
C:\DJGPP\bin\gxx -c Video.cpp -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions
C:\DJGPP\bin\gxx -c kernel.cpp -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions
C:\nasm\nasmw -f aout Loader.asm -o Loader.o
C:\DJGPP\bin\ld -T Link.ld -o Kernel.bin Kernel.o Video.o Loader.o
pause


any suggestions as to why i would be recieving this irritating error?

I am developing this under windows xp.

Re:ld is giving me errors

Posted: Mon Nov 08, 2004 1:53 am
by Solar
This is a deja vu, but I can't find references to it in the FAQ!?!

I think I remember DJGPP generating COFF object files, not a.out...

The "standard" answer here is, drop DJGPP, get Cygwin, and follow the GCC Cross-Compiler and BareBonesC++ tutorials in the OS-FAQ.

Re:ld is giving me errors

Posted: Mon Nov 08, 2004 9:18 pm
by forsaken_dragon
Thank you I will try those.