ILINK32 ERROR Unresolved external _main referenced from c:\program files\codegear\rad studio\5.0\lib\cox32.obj

Hi,

I'm a delphi guy trying to play with c++ builder in Rad Studio 2007 and
not doing so well......

I get the following error:  for the below program

ILINK32 ERROR Unresolved external _main referenced from c:\program
files\codegear\rad studio\5.0\lib\cox32.obj

here is the complete program:  can someone please explain what I am
doing wrong?

#include <windows.h>

int APIENTRY WinMain(HINSTANCE hInstance,       
		       HINSTANCE hPrevInstance,   
		       LPTSTR    lpCmdLine,       
		       int       nCmdShow)        
{
  return 0;
}

I also tried this with same result.

#include <windows.h>

WINAPI WinMain(HINSTANCE hInstance,       
	             HINSTANCE hPrevInstance,   
	             LPTSTR    lpCmdLine,       
	             int       nCmdShow)        
{
  return 0;
}

thanks, Michael
-2
Michael
8/27/2008 10:13:35 PM
embarcadero.cppbuilder.ide 2180 articles. 1 followers. Follow

2 Replies
5026 Views

Similar Articles

[PageSpeed] 50
Get it on Google Play
Get it on Apple App Store

In article <7544@forums.codegear.com>,
 Michael Messerschmidt <No@Spam.com> wrote:

> ILINK32 ERROR Unresolved external _main referenced from c:\program
> files\codegear\rad studio\5.0\lib\cox32.obj
> 
> here is the complete program:  can someone please explain what I am
> doing wrong?

   You are supplying winmain instead of main. I suspect you created a 
pure console application project rather than a windows application 
project. It matters in C++ because different startup code is called for 
different types of projects. (and you cannot change the project type 
after it has been created)
   If you are comfortable with Delphi, then creating a VCL application 
project is probably closer to what you are used to. (and makes the code 
you posted unnecessary)
-- 
David Dean (CodeGear)
Lead C++ QA Engineer
1
David
8/27/2008 10:28:26 PM
David Dean (CodeGear) wrote:

>    You are supplying winmain instead of main. I suspect you created a 
> pure console application project rather than a windows application 
> project. It matters in C++ because different startup code is called
> for different types of projects. (and you cannot change the project
> type after it has been created)
>    If you are comfortable with Delphi, then creating a VCL
> application project is probably closer to what you are used to. (and
> makes the code you posted unnecessary)

you are correct about the console app.  I didn't know that about not
being able to change the project type--makes sense why it doesn't work.

I'm basically using a 3D engine in Delphi (written in vs C++) and I
need to create a small sample in c++ that will compile in vs C++ to
prove to the 3D Engine owner that there is a bug--since they don't do
delphi I have to do c++ to send them samples.  I originally created a
console c++ app to show my point to them--of course that wasn't good
enough for them... they said my app should look like this:

int APIEntry WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR lpCmdLine,
                     int nCmdShow)
{
  ...do what I need here which is just a few calls to their engine
  return 0;
}

what type of project should I create to accomplish the goal (compiles
in vs c++)???
Is there any special settings I need to use???

many thanks!!
1
Michael
8/27/2008 10:54:57 PM
Reply:

Similar Artilces:

RAD Studio 2010 [ILINK32 Error] Error: Unresolved external 'InternetOpenA' referenced from *.obj
Hello, using some *.pas-files in an C++Builder project. Linker is complaining: [ILINK32 Error] Error: Unresolved external 'InternetOpenA' referenced from *.obj I have added wininet.h WinInet.hpp (created) WinInet.pas to the project, wininet.h added as #include, WinInet.obj is created. No success so far. Any hints? Many thanks and greetings Udo Hello, you also need WinInet.lib kind regards Heiner Hello Heinrich, > you also need WinInet.lib yep, that was the solution, many thanks. Greetings Udo "Udo Weik" <WeikEngOff@aol.com> ...

[ILINK32 Error]Error: Unresolved external 'wWinMain' referenced from $(BDS)C0W32W.OBJ
Hello, Had this problem with large project, so made a new VCL form project... Reason was to make sure that the settings for TCHAR were correct! Still get the following: [ILINK32 Error] Error: Unresolved external 'wWinMain' referenced from C:\PROGRAM FILES\CODEGEAR\RAD STUDIO\6.0\LIB\C0W32W.OBJ For some reason, ILINK seems to still be looking for the "w" version? //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include <tchar.h> //------------------------------------------------...

[ILINK32 Error] Error: Unresolved external 'Simpleds::TSimpleDataSet::' referenced from E:\DEBUG\XXX.OBJ
I have a package and I drop a TSimpleDataSet component on one of the projects forms. When the package links I get an error: [ILINK32 Error] Error: Unresolved external 'Simpleds::TSimpleDataSet::' referenced from E:\DEBUG\XXX.OBJ Is my project missing some .bpi that it needs to resolve this external? If so, what is the name of the .bpi? Larry I finally found it: dbxcds.bpi I kind of wish the IDE would add it to the requires section of the package project when I drop the TSimpleDataSet on a Form. "Larry Griffiths" <larry@kalos-inc.com> wrote ...

Re: [ILINK32 Error]Error: Unresolved external 'wWinMain' referenced from $(BDS)C0W32W.OBJ
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_11964.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" Ok, I've got a zip of the smallest project I can create the problem with... it contains a _tWinMain with a test form (absolutely nothing on it). The _tWinMain is a duplicate of my project code! But it differs very little from the one that was created by 2009 as a new project. None of my other code or header files is used in this test! The TestForm was on...

ANN: X-DBGrid Component 5.0 and X-Files Components 5.0 with RAD Studio XE2 support released!
Dear Developers, I'm pleased to announce the new version of X-DBGrid Component 5.0 and X-Files Components 5.0 has been released. What's new in version 5.0 ? ===================== - New packages for Delphi XE2 Win32/Win64 and C++Builder XE2!!! - All design-time packages redesigned and improved!!! - New powerful X-DBGrid Designer installed in IDE!!! - Extended lookup columns system defined in TXDBGrid - New TXColumn.LookupColumn property (read only) - New TXColumn.LookupResultField, KeyField property - New loAllowAdjustOrder option in TXColumn.ListOp...

ANN: X-DBGrid Component 5.0 and X-Files Components 5.0 with RAD Studio XE2 support released!
Dear Developers, I'm pleased to announce the new version of X-DBGrid Component 5.0 and X-Files Components 5.0 has been released. What's new in version 5.0 ? ===================== - New packages for Delphi XE2 Win32/Win64 and C++Builder XE2!!! - All design-time packages redesigned and improved!!! - New powerful X-DBGrid Designer installed in IDE!!! - Extended lookup columns system defined in TXDBGrid - New TXColumn.LookupColumn property (read only) - New TXColumn.LookupResultField, KeyField property - New loAllowAdjustOrder option in TXColumn.ListOp...

[ilink32 Error] Error: Unresolved external 'SHStrDupW' referenced from
I cannot understand why the above occurs, the header file exists, the Macro is defined in there and the cpp file has it too. Im beginning to think its a setting somewhere, im a hobbyist, not professional programmer and its a bit beyond me. It first occurred when trying to use the ribbon implementation from www.bilsen.com/windowsribbon So I created a VCL form and put a button on it which would call the offending function... it fails with the message [ilink32 Error] Error: Unresolved external 'SHStrDupW' referenced from C:\USERS\TIM\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG...

eVC++ PocketPC Linking error
Hi, I've created a new project in eVC++ using the Ultralite DB. I've used a Publication and generated the C++ code without error. I then included the generated file and the ulapi.cpp file into my project (both files were set to not use precompiled headers) All the source files compile fine, but then 'crashes' on the linking stage. The following are the error messages I get: ------------------------------ Generating Code... Linking... ulrt.lib(ssocket.obj) : error LNK2019: unresolved external symbol _ntohs referenced in function _load_dll ulrt.lib(ssocket.obj) : ...

64 Bit Machine..[ILINK32 Error] Error: Unresolved external '__fastcall System::AnsiStringBase::~AnsiStringBase()' referenced from ...
I just installed CG2007 [+upd 12/07] on a 64bit machine everything compiled correctly but I now get 3 Unresolved extrns...see below ...anyone got any idea what's causing this?? [ILINK32 Error] Error: Unresolved external '__fastcall System::AnsiStringBase::~AnsiStringBase()' referenced from C:\BORLAND\AMSLIB.LIB|getPensionPay [ILINK32 Error] Error: Unresolved external '__fastcall System::AnsiStringBase::AnsiStringBase(const char *, int)' referenced from C:\BORLAND\AMSLIB.LIB|getPensionPay [ILINK32 Error] Error: Unresolved external '__fastcall System::A...

[ILINK32 Error] Error: Unresolved external -- Error message
I have a VCL component compiled using Delphi 2010. This VCL component accesses functions in an external DLL. When I try to use this component in C++ Builder 2010, I get the error message below when compiling: [ILINK32 Error] Error: Unresolved external 'PdacOpenDatabase' referenced from C:\PROGRAM FILES (X86)\PERVASIVE SOFTWARE\PSQL\SDK\PDAC\DELPHI2010\LIB\PB200R2010.LIB|btvtables This only occurs when "Build with runtime packages" is unchecked and only within C++ Builder. If I compile the same basic program in Delphi, it works using runtime packages or not. Any id...

Codegear rad studio 2007 ide error
I sometimes get following ide error while I am editing any cpp file. I use Codegear Rad studio 2007 and win XP sp3. "Assertion failed: amount>= dest- startDest, file ek_flbuf.cpp, line 315." After ide displays this error, "Abnormal Program Termination" error is displayed. Is there any solution for this ide-based error. ...

RAD Studio 2010 Error: Unresolved external
I ported my Borland C++ Builder 6 application (contains both Borland C++ and two pascal files) to RAD Studio 2010 C++ Builder 2010. The .hpp file that is created from the pascal file seems to be only partially completed and I get the following errors: Can you please help? [BCC32 Error] readlist.hpp(48): E2187 Unexpected end of file in conditional started on line 7 Full parser context main.cpp(136): #include readlist.hpp readlist.hpp(23): namespace Readlist readlist.hpp(42): class ViewType The partially completed .hpp file is: // Copyright (c) 1995, 2009 by Embarca...

Error 5 Metadata file 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\wwwroot\8401b9a0\5d5c888\App_Web_yg21rqdn.dll' could not be found
Hi when building websometime I get this error??? Error    5    Metadata file 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\wwwroot\8401b9a0\5d5c888\App_Web_yg21rqdn.dll' could not be found        how to get rid off it  ??? rekoms: sometime I get this error???Error    5    Metadata file 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\wwwroot\8401b9a0\5d5c888\App_Web_yg21rqdn.dll' could not be foundhow to get rid off itThere ar...

ANN: X-DBGrid Component 5.5 and X-Files Components 5.5 with support for RAD Studio XE5!
Dear Developers, I'm pleased to announce the new version of X-DBGrid Component 5.5 and X-Files Components 5.5 with support for RAD Studio XE5. What's new in version 5.5 ? ======================= - New packages for Delphi/C++Builder XE5 Win32/Win64!!! - The ShowBlob property accepts also ftWideMemo fields - Default value for property EditMemo changed to True - Bug fixed: X-DBGrid's white background problem was solved (RAD 2010 only) - Bug fixed: X-DBGrid Designer's problem with large screen fonts was solved What's new in version 5....

Web resources about - ILINK32 ERROR Unresolved external _main referenced from c:\program files\codegear\rad studio\5.0\lib\cox32.obj - embarcadero.cppbuilder.ide

Unresolved Mysteries (@r_Unresolved) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Western Sydney Wanderers' threat of Club World Cup boycott unresolved
Western Sydney Wanderers were a club in turmoil on Sunday night as players and management held a crisis meeting brokered by the players' union ...

Reflections on Gallipoli review: Australian Chamber Orchestra sets our unresolved view of Gallipoli to ...
As with all war reflections, the over-riding message of the ACO's concert was Why?

Melbourne Metro: challenge of tunnelling beneath Yarra River still unresolved
The complex engineering challenge of building the $11 billion rail tunnel has yet to be fully resolved.

Public Islam stirs unresolved Christian anger, reverend says
The public nature of Islam has&nbsp;stirred a&nbsp;deep down unresolved anger&nbsp;in Christianity in Australia, one of the nation's leading ...

Iran nuclear talks to extend past deadline as 'difficult issues' remain unresolved, US officials say
The US extends a deadline for a nuclear deal with Iran, as negotiators struggle to reach political agreement.

LRT questions still unresolved after city and province meet
The province said it is committed to fully funding the capital costs of a Hamilton transit project- which is exactly what councillors who were ...

GOP's McSally wins last unresolved House race - 12 News
Republican Martha McSally won the last unresolved House race of the 2014 midterm election, ousting Democratic Rep. Ron Barber the Arizona district ...

Report details labor violations left unresolved at Apple supplier in China
... to find more special coverage of AAPL Company , Apple , and iPhone . What do you think? Discuss "Report details labor violations left unresolved ...

FTC Staff Report on Internet of Things: Recommends Self-Regulation “Best Practices,” But Leaves Key Issues ...
The Federal Trade Commission released its much anticipated staff report on January 27 regarding consumer privacy and data security concerns arising ...

Resources last updated: 2/11/2016 11:36:22 PM