windows a.out file

Programming, for all ages and all languages.
Post Reply
Binmese
Posts: 6
Joined: Mon Apr 13, 2009 1:46 am

windows a.out file

Post 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...
Tulga
Posts: 2
Joined: Mon Apr 13, 2009 12:18 pm

Re: windows a.out file

Post by Tulga »

i think you should try it on a linux disturbition :P
Binmese
Posts: 6
Joined: Mon Apr 13, 2009 1:46 am

Re: windows a.out file

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

Re: windows a.out file

Post 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.
Every good solution is obvious once you've found it.
Binmese
Posts: 6
Joined: Mon Apr 13, 2009 1:46 am

Re: windows a.out file

Post by Binmese »

thanx for reply and advices :)
thanks again
Post Reply