BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

unresolved "main" from c0x32.obj and ilink32 error code 2

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Installation
View previous topic :: View next topic  
Author Message
Robert
Guest





PostPosted: Thu Aug 24, 2006 2:33 am    Post subject: unresolved "main" from c0x32.obj and ilink32 error code 2 Reply with quote



Working on windows xp platform woth c++builderX Personal and began to work on Hello World and can't get the ilink32 program to work. Hello World compiles to hello.obj when built separately, but I keep getting the following link error below.
I have installed update 1 and the ilink32 patch as recommended by support, but it does not help. I have assumed the ilink32.dll and exe go in the c++builderX\bin folder. Does anyone know for sure? A search of my files before the ilink patch didn't turn up any ilink32.dll file. Anyone else gone through this???

ilink32 -ap -Tpe -x -Gn C:\CBuilderX\lib\c0x32.obj,"C:\Documents and Settings\User\cbproject\ConsoleApp1\windows\Release_Build\ConsoleApp1.exe",,cw32.lib import32.lib,,
Turbo Incremental Link 5.66 Copyright (c) 1997-2002 Borland
Error: Unresolved external '_main' referenced from C:\CBUILDERX\LIB\C0X32.OBJ
ILINK32 exited with error code: 2
Build cancelled due to errors

Any help would be appreciated
Robert
Back to top
Ed Mulroy
Guest





PostPosted: Thu Aug 24, 2006 6:32 pm    Post subject: Re: unresolved "main" from c0x32.obj and ilink32 error code Reply with quote



Source file is hello.cpp so its object file is hello.obj

The linker command line contains comma separated fields
which are as follows:

object files (options usually also placed here)
name of file to create
map file name
names of libraries
names of module definition files
names of resource files

The command can be truncated at the last field used.

In the following command the list of object files only includes the startup
code, c0x32.obj. The object file hello.obj is not listed. This guarantees
the "_main not found" error that you received and suggests that either
hello.cpp was not added to the project. This error is independent of and
not subject to any linker patch. No version of the linker is going to know
what object files to include unless you tell it of them.

Quote:
ilink32 -ap -Tpe -x -Gn C:\CBuilderX\lib\c0x32.obj,"C:\Documents and
Settings\User\cbproject\ConsoleApp1\windows\Release_Build\ConsoleApp1.exe",,cw32.lib
import32.lib,,

CBuilderX and C++ Builder are different products. As can be seen in its
name, this newsgroup is for C++ Builder. Please post CBuilderX questions in
CBuilderX newsgroups.

follow-up set to borland.public.install.cbuilderx

.. Ed

Quote:
Robert wrote in message
news:4288327.1156386834880.JavaMail.SYSTEM@USSVS-TECHWEB1...
Working on windows xp platform woth c++builderX Personal
and began to work on Hello World and can't get the ilink32
program to work. Hello World compiles to hello.obj when built
separately, but I keep getting the following link error below.

I have installed update 1 and the ilink32 patch as recommended
by support, but it does not help. I have assumed the ilink32.dll
and exe go in the c++builderX\bin folder. Does anyone know for
sure? A search of my files before the ilink patch didn't turn up
any ilink32.dll file. Anyone else gone through this???

ilink32 -ap -Tpe -x -Gn C:\CBuilderX\lib\c0x32.obj,"C:\Documents and
Settings\User\cbproject\ConsoleApp1\windows\Release_Build\ConsoleApp1.exe",,cw32.lib
import32.lib,,
Turbo Incremental Link 5.66 Copyright (c) 1997-2002 Borland
Error: Unresolved external '_main' referenced from
C:\CBUILDERX\LIB\C0X32.OBJ
ILINK32 exited with error code: 2
Build cancelled due to errors

Any help would be appreciated
Robert
Back to top
Paul Collins
Guest





PostPosted: Mon Oct 09, 2006 12:35 pm    Post subject: Re: unresolved "main" from c0x32.obj and ilink32 error code Reply with quote



I have encountered this error when trying to make a Unicode console application and using the macros in tchar.h. It works OK when Unicode is not enabled, but as soon as you specify -WU on the compiler command line, _tmain() becomes mapped to wmain() and the link fails. Is there a way to resolve this, please???
Back to top
Ed Mulroy
Guest





PostPosted: Mon Oct 09, 2006 6:23 pm    Post subject: Re: unresolved "main" from c0x32.obj and ilink32 error code Reply with quote

I have not seen this problem for several versions so do not know if this
still solves it but it is easy to try. Add a line with exterm "C" on it
immediately before the line with _tmain

.. Ed

Quote:
Paul Collins wrote in message
news:21782496.1160397346710.JavaMail.SYSTEM@USSVS-TECHWEB1...

I have encountered this error when trying to make a Unicode
console application and using the macros in tchar.h. It works
OK when Unicode is not enabled, but as soon as you specify -WU
on the compiler command line, _tmain() becomes mapped to
wmain() and the link fails. Is there a way to resolve this, please???
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Installation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.