Talk:How kernel, compiler, and C library work together
Non-matching symbols
The page references to both ___main and __main as being the same things. Probably, one of them has a _ too much or too few. My guess would be that it needs two, but could someone confirm that? - Combuster 02:51, 3 July 2007 (CDT)
Actually in my kernel both _alloca and _main only have 1 underscore. But after a little research on the internet it seems that the number of underscores varies between platforms and file types. For example a.out has 2 and elf has 1. But then again the person that wrote this could have been thinking about how some C compilers prefix underscores to their functions. I don't know. I think that we should just pick one of them and make it consistent. --Frank 08:54, 3 July 2007 (CDT)
The text refers to PE binaries. So its either MinGW or MSVC that created the code. Still I doubt that either generates 3 underscores, although you never know with Microsoft. If its indeed compiler-dependent we should indeed pick a default (Not unlikely, as my ELF toolchain doesn't prefix underscores to main while yours does). Could someone post the MSVC variant for reference? - Combuster 06:12, 5 July 2007 (CDT)
Well I was talking about the fact the linker throws an error about not having _main even though I have main declared. My ELF toolchain doesn't prefix underscores on my functions. You just have to include a stub _main for it to link properly. I have been playing around with MS visual studio for a while now and it doesn't seem to want to call _main or __main before it calls main, but it does prefix all symbols with an underscore when in c mode. What do you think? --Frank 15:31, 5 July 2007 (CDT)
Unformatted Text
I can't figure out why the text in a few sections around 'Static Linking' are unformatted.....Any ideas? - Alboin (please sign your posts)
They are prefixed with whitespace, causing them to be interpreted as a code block. - Combuster 02:47, 22 March 2007 (CDT)