Page 1 of 1

windows a.out file

Posted: Tue Apr 14, 2009 3:53 am
by Binmese
hi every body.

I wanna compile my code file to a.out. I tried to do it by gcc.exe with a .bat file.


this is my makefile.bat

Code: Select all

gcc -c kernel.c -o kernel.o
rename a.out kernel.bin
in this folder i installed gcc with mingw. but i couldn't do it. But nothing happened. i tried to it by dev c++ but dev c++ only compile file to .exe format. can i do it with dev c++ or with shell?

i am working on windows

thanx everybody...

Re: windows a.out file

Posted: Tue Apr 14, 2009 3:57 am
by Tulga
i think you should try it on a linux disturbition :P

Re: windows a.out file

Posted: Tue Apr 14, 2009 3:59 am
by Binmese
no wanna do it on windows couse there are a lot of projects and file and programs in my computer. is there anyway to do it on windows?

Re: windows a.out file

Posted: Tue Apr 14, 2009 4:31 am
by Solar
First (and important!), file names have nothing to do with their format. Rename pic.gif to pic.jpeg, and you still have a GIF picture.

The same, only more so, applies to binary files. GCC defaults to the filename a.out, no matter if it's a.out format or (much more likely today) ELF format (on Linux) or PE format (on Windows).

That being said, your batchfile line

Code: Select all

gcc -c kernel.c -o kernel.o
tells the compiler to not create an executable at all, no matter the format, but to generate a linker object file. Moreover, you explicitly told the compiler to name the file kernel.o.

At this point, I strongly suggest that you forget about the idea of doing anything kernel-related for at least one year, and begin with learning to code, and to use coding tools, with "normal" user-space applications.

You will save yourself - and us - lots of trouble that way.

Re: windows a.out file

Posted: Tue Apr 14, 2009 4:43 am
by Binmese
thanx for reply and advices :)
thanks again