Board index » cppbuilder » unresolved "main" from c0x32.obj and ilink32 error code 2

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


2006-08-24 03:33:21 AM
cppbuilder87
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
 
 

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

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
 

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

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???
 

{smallsort}

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

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???