Article View: borland.public.cppbuilder.nativeapi
Article #16519Re: learning WinAPI
From: Buster
Date: Mon, 12 May 2003 11:38
Date: Mon, 12 May 2003 11:38
42 lines
2240 bytes
2240 bytes
"Jeffrey M Tomsak" <jerf_@hotmail.com> wrote in message
news:3ebf7e7d$1@newsgroups.borland.com...
> Ok, I'm a newbie at this Windows programming, and I'm running into
problems.
> I'll have a lot more questions in the future, but for now:
>
> [Linker Error] Unresolved external '_main' referenced from
C:\PROGRAM
> FILES\BORLAND\CBUILDER6\LIB\C0X32.OBJ
>
> What does this mean, and how do I get rid of it? I'm trying to make
a
> simple Win app. It seems more trouble than its worth, but in the
long run
> it won't be.
>
> Jeff M T
c0X32 contains startup code (the stuff that's executed before your
main or WinMain).
In this case, I would guess you're linking with the version of the
startup code that calls main, when in fact your main entry point is
WinMain ().
There are a couple of ways to make a windows app in the IDE.
1. (Using the VCL) Use File->New->Application, or use
File->New->Other... and select Application.
2. (Without the VCL) Use File->New->Other..., select Console Wizard
and uncheck the "Console App" box. This should create a project
containing instructions to link the correct startup code for calling
WinMain (): in the .bpr file,
...
<LINKER>
<ALLOBJ value="c0w32.obj $(PACKAGES) $(OBJFILES)"/>
...
c0w32 is the correct version.
Best of luck.
Technical Details
Message-ID:
<3ebf87b1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3ebf7e7d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,7d1c90fac0ccedbc X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-12 04:45:51 PST From: "Buster" <rcopley@ukonline.co.uk> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ebf7e7d$1@newsgroups.borland.com> Subject: Re: learning WinAPI Date: Mon, 12 May 2003 12:38:20 +0100 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 81.77.95.199 Message-ID: <3ebf87b1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1052739505 81.77.95.199 (12 May 2003 04:38:25 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail