ld is giving me errors

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
forsaken_dragon

ld is giving me errors

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:ld is giving me errors

Post 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.
Every good solution is obvious once you've found it.
forsaken_dragon

Re:ld is giving me errors

Post by forsaken_dragon »

Thank you I will try those.
Post Reply