From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Mills To: 'eCos Discussion' Cc: John Mills Subject: [ECOS] SWtools g++ usage question Date: Tue, 15 Jun 1999 07:54:00 -0000 Message-id: X-SW-Source: 1999-06/msg00007.html 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 -gcc. If I change main's name from .c to .cpp (with no changes to the other files) and recompile that object with -g++, the link fails with an unresolved label "__main()". .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)