This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
[ECOS] SWtools g++ usage question
- To: 'eCos Discussion' <ecos-discuss@sourceware.cygnus.com>
- Subject: [ECOS] SWtools g++ usage question
- From: John Mills <Jmills@TGA.com>
- Date: Tue, 15 Jun 1999 11:00:09 -0400
- Cc: John Mills <Jmills@TGA.com>
Greetings - I'm new to cross-platform 'gcc' and to C++, so this is probably
a simple question: sorry it is more a 'g++' than an eCos question. Sorry
also if this is excessive detail.
I have a simple program - one "real" object and the three or so supporting
files to target an embedded processor (SH-2). It compiles and links
perfectly
when compiling with <target>-gcc.
If I change main's name from <name>.c to <name>.cpp (with no changes to the
other files) and recompile that object with <target>-g++, the link fails
with an unresolved label "__main()". <sample>.cpp includes both a
'main(void)' (the actual 'C' entry), and also a reference line: 'int
__main(){}' which I inherited in my example. Commenting-out either 'main'
reference doesn't seem to change the error. I suppose this is must be a FAQ,
but I would be grateful for any explanation.
I'm working with 'ecosSWtools-990319', built under RH6.0. It is not a full
eCos tools build (I don't have 'sh-hms-gdb'), but the essentials seem to
have built: I compiled my 'C' main, assembled all, and linked an executable,
then exported source and executable to a WinNT box where I downloaded and
debugged -- stepping through source while running in off-board hardware
[EDK7045F] -- under Hitachi's IDE (which may or may not have used 'gdb' to
debug).
TIA for any suggestions. I'll be happy to provide more details to anyone.
Regards -
John Mills, Sr. Software Engineer
TGA Technologies, Inc.
100 Pinnacle Way, Suite 140
e-mail: jmills@tga.com
Norcross, GA 30071-3633
Phone: 770-421-2100 ext.124 (voice)
770-449-7740 (FAX)