🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11091

Re: _main from C0X32.OBJ

#11091
From: Bob Gonder
Date: Thu, 26 Feb 2004 17:55
18 lines
1835 bytes
PC Hua wrote:

>Yes, there's int main( int argc, char* argv[] ). Seems there's another 
>_main in c0x31.obj

No, c0x32 *calls* _main.  It requires there to be a _main defined
somewhere in your code. The error message was that it couldn't *find*
_main in any of the object files.

Are you compiling this as a cpp file?  If so, then you need to do the
extern "C"{} around the main(), otherwise the name of main gets
mangled, and is no longer _main

Also, I seem to recall a couple of compile flags, such as "Don't
Generate Underlines" which would end up with main being defined as
main instead of _main, and you'd get that error.  To fix that problem,
you could either turn off that switch, or rename main to
int _main( int argc, char* argv[] )
Technical Details
Message-ID: <q7cs305p3hspf0hunobrp8gels6bfic6a7@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <opr3ychqrepmxkmr@newsgroups.borland.com> <bijq30p1f4u66bu2pe8l0p7ietdfbs0fji@4ax.com> <opr3yiyzt0pmxkmr@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,edfef17740a11661
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-02-26 10:10:55 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: _main from C0X32.OBJ
Date: Thu, 26 Feb 2004 09:55:17 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <q7cs305p3hspf0hunobrp8gels6bfic6a7@4ax.com>
References: <opr3ychqrepmxkmr@newsgroups.borland.com> <bijq30p1f4u66bu2pe8l0p7ietdfbs0fji@4ax.com> <opr3yiyzt0pmxkmr@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 65.56.158.223
X-Trace: newsgroups.borland.com 1077818119 65.56.158.223 (26 Feb 2004 09:55:19 -0800)
Lines: 21
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail