public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] SWtools g++ usage question
@ 1999-06-15  7:54 John Mills
  0 siblings, 0 replies; only message in thread
From: John Mills @ 1999-06-15  7:54 UTC (permalink / raw)
  To: 'eCos Discussion'; +Cc: John Mills

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-06-15  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-15  7:54 [ECOS] SWtools g++ usage question John Mills

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).