Click to See Complete Forum and Search --> : A Linking Error -> error LNK2019


lovish_dhawan
July 20th, 2006, 07:16 AM
Hi All,
I am a new bie here. I am facing a linking Issue.

corelibc.lib(pegwmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function WinMainCRTStartup

I am making a solution for a Windows Mobile 5.0 based Pocket PC and facing this issue

I have searched for this problem and a solution in msdn but found no cigar..

Thanks in advance

Lovish

humptydumpty
July 20th, 2006, 07:41 AM
Here is Something from MSDN
These operating system functions use the _stdcall calling convention, but the compiler is
declaring them as _cdecl. This problem occurs with the Windows CE Platform SDK for Pocket
PC because the functions are incorrectly declared in the Windbase.h file without a linkage
type.

Use one of the following workarounds:

Add the /Gz compiler switch to the configuration's project settings when building for Pocket
PC emulation.

-or-


If the first workaround prevents other functions/libraries from linking in your project, then
modify the Windows CE database function declarations in the Windbase.h file. For example,
for the error in the "Symptoms" section, change the following declaration


BOOL CeDeleteDatabase (CEOID oid);
to read:
BOOL WINAPI CeDeleteDatabase (CEOID oid);



Thanx

lovish_dhawan
July 20th, 2006, 07:53 AM
Thanks for your quick reply. I just check by setting the compiler flag and let u know.. Thanks again

humptydumpty
July 20th, 2006, 08:02 AM
you welcome dude :p

Thanx

lovish_dhawan
July 20th, 2006, 08:13 AM
Hi Humpty,
I tried the way you told me, but it seems that compiler doesnt know this flag.
The location from where I am picking my compiler is
C:\Program Files\Microsoft Visual Studio 8\VC\ce\bin\x86_arm\cl

and it is saying

cl : Command line warning D9002 : ignoring unknown option '/Gz'

Where I am missing..

Thanks

Lovish

lovish_dhawan
July 21st, 2006, 07:46 AM
Hi Guys,
The problem is solved now, thanks for your time

Thnx
Lovish