Page 2 of 2

Re: Kernel.bin not compiling correctly.

Posted: Fri Nov 25, 2005 12:00 am
by carbonBased
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

Re: Kernel.bin not compiling correctly.

Posted: Fri Nov 25, 2005 12:00 am
by robert macabre
ah, i didn't know that.

Re: Kernel.bin not compiling correctly.

Posted: Sat Nov 26, 2005 12:00 am
by UnsurpassedBlaze
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?

Re: Kernel.bin not compiling correctly.

Posted: Sun Nov 27, 2005 12:00 am
by carbonBased
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

Re: Kernel.bin not compiling correctly.

Posted: Mon Nov 28, 2005 12:00 am
by blackcatcoder
if you compile with gcc try to use -fnobuiltin

use:

gcc -c -fnobuiltin -o .......

and if it works -fnostdinc i think!

Re: Kernel.bin not compiling correctly.

Posted: Mon Nov 28, 2005 12:00 am
by dave
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

Re: Kernel.bin not compiling correctly.

Posted: Tue Nov 29, 2005 12:00 am
by UnsurpassedBlaze
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.

Re: Kernel.bin not compiling correctly.

Posted: Fri Jan 06, 2006 12:00 am
by la_virtud
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.