__main undefined symbol
William Gatliff
gatliff@haulpak.com
Sat Apr 1 00:00:00 GMT 2000
Scott A Sumner wrote:
> I tried the _main() wart trick on my embedded system, but got a linker error so
> had to back it out.
Are you saying that the _main() wart was the origin of the linker bug?
Hmmm.... are you sure you aren't compiling C++? I'm not exactly sure what the
proper signature for _main() is, is why I ask...
> Time to vent: On a related (startup code) and again frustrating note, my
> implementation of gcc requires me to have a crt0.o file. This is not so
> bad in itself (although I can't rename it or change its extension), but what
> bugs me to no end is that it has to be in a subdirectory in the compiler's
> directory tree.
The -nostartfiles switch tells gcc to not use the installed crt0. See also the
-nodefaultlibs and -nostdlib switches for related behavior.
Once you throw the -nostartfiles switch, you're free to do whatever you want
startup-wise. Probably should include a call to main() somewhere, of course.
:^)
b.g.
--
William A. Gatliff
Senior Design Engineer
Komatsu Mining Systems
To teach is to learn.
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list