Board index » cppbuilder » [Linker Error] Unresolved external 'WinMain'

[Linker Error] Unresolved external 'WinMain'


2003-10-15 11:56:03 AM
cppbuilder26
This is a problem I've had for a while now, and I have posted about it
previously.
I have spent a great deal of file eliminating possible reasons, and this is
what I have done:
1. Uninstall my Trial Version of CBuilder 6;
2. Install a full copy of CBuilder 6 Pro;
3 Patch it to version 4;
4. Install ThirdParty tools (Raize Comps, CodeSite, TeeCharts & QuickReports
Pro)
5. Created a new Windows Project file (NOT console);
6. Added my Source files to the new project;
7. Build All.
The I alway get the following error no matter what I do:
[Linker Error] Unresolved external 'WinMain' referenced from C:\PROGRAM
FILES\BORLAND\CBUILDER6\LIB\C0W32.OBJ
Any help would be appreciated
Thanks
Chris
 
 

Re:[Linker Error] Unresolved external 'WinMain'

Assuming you've created a windows application, WinMain is where *your*
windows program begins. Without it, your application can not run. If you
select Project | View Source, you should see a file with WinMain. This file
probably starts with lines with USEFORM(...), followed with WINAPI
WinMain(HINSTANCE,HINSTANCE,LPSTR,int).
If you don't get this start with a new project and see if this one has a
WinMain. Then add your files to the project.
If your application isn't a default windows application, then probably you
don't need WinMain but somewhere the settings for builder are incorrect.
Start with a new application, of your type, and add your files to it.
Wim
"Chris Durkin" < XXXX@XXXXX.COM >schreef in bericht
Quote
This is a problem I've had for a while now, and I have posted about it
previously.
I have spent a great deal of file eliminating possible reasons, and this
is
what I have done:
1. Uninstall my Trial Version of CBuilder 6;
2. Install a full copy of CBuilder 6 Pro;
3 Patch it to version 4;
4. Install ThirdParty tools (Raize Comps, CodeSite, TeeCharts &
QuickReports
Pro)
5. Created a new Windows Project file (NOT console);
6. Added my Source files to the new project;
7. Build All.

The I alway get the following error no matter what I do:
[Linker Error] Unresolved external 'WinMain' referenced from C:\PROGRAM
FILES\BORLAND\CBUILDER6\LIB\C0W32.OBJ

Any help would be appreciated
Thanks
Chris


 

Re:[Linker Error] Unresolved external 'WinMain'

My project source looks fine "WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR,
int)"
It has been amended to have a splash screen, but this is all code that was
working in CBuilder 5
Thanks. Any other suggestions?
Chris
"Wim Bekker" <wim@bekker>wrote in message
Quote
Assuming you've created a windows application, WinMain is where *your*
windows program begins. Without it, your application can not run. If you
select Project | View Source, you should see a file with WinMain. This
file
probably starts with lines with USEFORM(...), followed with WINAPI
WinMain(HINSTANCE,HINSTANCE,LPSTR,int).
....
 

{smallsort}

Re:[Linker Error] Unresolved external 'WinMain'

I cannot figure out if your code is working now, but, if not, probably you
have some errors in the source. Then maybe you can show it?
Wim
"Chris Durkin" < XXXX@XXXXX.COM >schreef in bericht
Quote
My project source looks fine "WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR,
int)"
It has been amended to have a splash screen, but this is all code that was
working in CBuilder 5
Thanks. Any other suggestions?

Chris

"Wim Bekker" <wim@bekker>wrote in message
news: XXXX@XXXXX.COM ...
>Assuming you've created a windows application, WinMain is where *your*
>windows program begins. Without it, your application can not run. If you
>select Project | View Source, you should see a file with WinMain. This
file
>probably starts with lines with USEFORM(...), followed with WINAPI
>WinMain(HINSTANCE,HINSTANCE,LPSTR,int).
....


 

Re:[Linker Error] Unresolved external 'WinMain'

...
USEFORM("TMainForm.cpp", MainForm);
#include "...
bool fDemoMode;
...
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
CSDMod = new TCSDMod(Application);
InitCodeSite();
// if you get here then demo/trial mode or validations setup
Splash = new TSplash(Application);
Splash->Show();
PlaySound(MAKEINTRESOURCE(ID_STARTUP_SOUND), HInstance, SND_RESOURCE |
SND_ASYNC);
Splash->Update();
Application->CreateForm(__classid(TMainForm), &MainForm);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
 

Re:[Linker Error] Unresolved external 'WinMain'

WinMain isn't found?
No errors here but you might want to check the include files.
BTW I have mine include files all before USEFORM, but this should make any
difference.
"Chris Durkin" < XXXX@XXXXX.COM >schreef in bericht
Quote
...
USEFORM("TMainForm.cpp", MainForm);
#include "...
bool fDemoMode;
...
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)