The use of underscore is actually a part of the ABI, not the compiler. ELF states no underscores, COFF uses underscores.
You can force GCC to generate or remove understores with command line options if you need to, with the following (iirc):
-fno-leading-underscore
-fleading-underscore
Kernel.bin not compiling correctly.
- carbonBased
- Member
- Posts: 382
- Joined: Sat Nov 20, 2004 12:00 am
- Location: Wellesley, Ontario, Canada
- Contact:
-
- Member
- Posts: 26
- Joined: Fri Nov 18, 2005 12:00 am
- Location: a perfect view out of the novotel
Re: Kernel.bin not compiling correctly.
ah, i didn't know that.
- UnsurpassedBlaze
- Posts: 10
- Joined: Wed Nov 02, 2005 12:00 am
- Location: Somewhere on Earth...
Re: Kernel.bin not compiling correctly.
Well in my other posts I already stated that it's not the underscores that's the problem, it's the actual compilation.
Now I'm wondering, is there a good linker for the windows os that I can use to compile my kernel?
Now I'm wondering, is there a good linker for the windows os that I can use to compile my kernel?
The code is only as good as the programmer.
- carbonBased
- Member
- Posts: 382
- Joined: Sat Nov 20, 2004 12:00 am
- Location: Wellesley, Ontario, Canada
- Contact:
Re: Kernel.bin not compiling correctly.
You mean its the linking, not the compilation. In all your posts, the errors have been during linking.
Linkers never compile code, they just link.
As per a good linker, why wouldn't you continue to use ld?
This seems like a fairly trivial linking issue... have you ever written a multi-file project before?
Using 'objdump' might give you some insight into what's going wrong.
--Jeff
Linkers never compile code, they just link.
As per a good linker, why wouldn't you continue to use ld?
This seems like a fairly trivial linking issue... have you ever written a multi-file project before?
Using 'objdump' might give you some insight into what's going wrong.
--Jeff
-
- Member
- Posts: 132
- Joined: Wed Nov 03, 2004 12:00 am
- Location: Austria
- Contact:
Re: Kernel.bin not compiling correctly.
if you compile with gcc try to use -fnobuiltin
use:
gcc -c -fnobuiltin -o .......
and if it works -fnostdinc i think!
use:
gcc -c -fnobuiltin -o .......
and if it works -fnostdinc i think!
Re: Kernel.bin not compiling correctly.
As I originally told him there is subtle problems gcc and ld on windows which can cause some incredible headaches. While yes it is a linking problem the only work arounds I found fixed one problem but created another. I recommend jsut setting up a linux machine ( virtual or real ) to do your work on as it will just save you many headaches if your going to continue using gcc and ld.
dave
dave
- UnsurpassedBlaze
- Posts: 10
- Joined: Wed Nov 02, 2005 12:00 am
- Location: Somewhere on Earth...
Re: Kernel.bin not compiling correctly.
I'll try to do what dave said about creating a virtual linux machine. It seems like a good shot and I'll try it out. If things still go wrong I'll post up the new problems, thanks for helping me out ^_^. Anyways, yes it is a linker problem and it always seem to have to do with my main Kernel file.
The code is only as good as the programmer.
Re: Kernel.bin not compiling correctly.
If you want to write the kernel on Windows, you should use DJGPP. When compiling C++ code for the kernel, you should use "-fnostdlib", "-fno-rtti", "-fno-exceptions", and it should work.