Ld error? File format not recognized
Ld error? File format not recognized
Hello all, I'm having some problems. I'm following James Molloy's tutorial and it's worked fine up to this point.
I'm at the 3rd part of the tutorial where it's talking about writing to the screen. I typed it all in and hit make, but I get the following error:
boot.o: file not recognized: File format not recognized
To make sure it wasn't a typo, I extracted the source from the tar available on the website, and still the same thing.
Why would this be happening?
I'm on windows by the way.
I'm at the 3rd part of the tutorial where it's talking about writing to the screen. I typed it all in and hit make, but I get the following error:
boot.o: file not recognized: File format not recognized
To make sure it wasn't a typo, I extracted the source from the tar available on the website, and still the same thing.
Why would this be happening?
I'm on windows by the way.
Re: Ld error? File format not recognized
make sure you "make clean" before you "make". I accidentally tarred up some object files in the downloads I put on my site, and they of course will only work properly in my build environment. "make clean" will remove all those .o's and force "make" to build them from scratch again.samoz wrote:Hello all, I'm having some problems. I'm following James Molloy's tutorial and it's worked fine up to this point.
I'm at the 3rd part of the tutorial where it's talking about writing to the screen. I typed it all in and hit make, but I get the following error:
boot.o: file not recognized: File format not recognized
To make sure it wasn't a typo, I extracted the source from the tar available on the website, and still the same thing.
Why would this be happening?
I'm on windows by the way.
If that's not the problem then I assume that the cygwin toolchain doesn't support ELF properly, but that's for someone more used to cygwin than me to work out.
- ollie123
- Member
- Posts: 26
- Joined: Tue May 27, 2008 2:42 am
- Location: Great Yarmouth, Norfolk, United Kingdom
Is it assembly code? Are you using NASM? If you are, make sure your command line is
Code: Select all
nasm -f elf -o boot.o [your asm file here]
NEW TO OPERATING SYSTEM DEVELOPMENT
Good OS Development Tutorials: http://www.brokenthorn.com/Resources/OSDevIndex.html
Good OS Development Tutorials: http://www.brokenthorn.com/Resources/OSDevIndex.html
-
- Posts: 1
- Joined: Wed Dec 22, 2010 3:58 pm
Re: Ld error? File format not recognized
try this
nasm -f coff -o boot.o
nasm -f coff -o boot.o
Last edited by MELLOMAN5123 on Sun Mar 13, 2011 9:36 pm, edited 1 time in total.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Ld error? File format not recognized
Hmm, necroposting, doing so with a broken answer, and then asking to reply by mail.
None of the three is good etiquette
None of the three is good etiquette