Re: Linker cannot find WinMain() in object
From: Michael J. Salamone [eMVP] (mikesa#at#entrek#dot#com)
Date: 07/11/04
- Next message: Anthony C: "RE: capturing mouse and keyboard events on WM2003"
- Previous message: Andrew McGrath: "Re: How to run a program automatically when the device is started up"
- In reply to: Min Sheng Lu: "Linker cannot find WinMain() in object"
- Next in thread: Min Sheng Lu: "Re: Linker cannot find WinMain() in object"
- Reply: Min Sheng Lu: "Re: Linker cannot find WinMain() in object"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 11 Jul 2004 16:15:27 -0700
Link against corelibc. libc.lib is not used in Windows CE, and is not
anything you should have in your SDK or on your lib path.
--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
"Min Sheng Lu" <minsheng.lu@antlimited.com> wrote in message
news:evjW6kdZEHA.1152@TK2MSFTNGP09.phx.gbl...
> Hi all,
>
> I am porting an application to WinCE.net, and I found that compilation
> fails at the linking stage as the linker cannot find the entry point in
> my compiled objects:
>
> "LIBC.lib(wincrt0.obj) : error LNK2019: unresolved external symbol
> _WinMain@16 referenced in function _WinMainCRTStartup"
>
>
> Now this is strange as WinMain() is declared correctly and compiled ok,
> and the linker options have /entry:WinMainCRTStartup set so things
> should work ok.
>
> I am currently linking against winmgr.lib, coredll.lib and winsock.lib
> only, and NOT corelibc.lib, would that make a difference?
>
> I tried to write a dummy test function, shown below, and tried to link
> that against coredll.lib but the linker still gives the same error. So a
> bit confused now and any help would be much appreciated.
>
> Thanks
>
> Min
>
> file:main.c
>
> #include <winbase.h>
>
> int
> WINAPI
> WinMain(
> HINSTANCE hInstance,
> HINSTANCE hPrevInstance,
> LPWSTR lpCmdLine,
> int nShowCmd
> )
> {
> int argc = __argc;
> char **argv = __argv;
> NOT_USED( hPrevInstance);
> NOT_USED( lpCmdLine);
>
> /* skip function name */
> argc--;
> argv++;
> return 0;
> }
>
> Linker output:
>
> C:/WINCE420/SDK/BIN/I386/link /nologo /base:"0x00010000"
> /stack:0x10000,0x1000 /entry:"WinMainCRTStartup" /incremental:no
> /pdb:"SIS550" /out:bin/main.exe main.obj coredll.lib
> LIBC.lib(wincrt0.obj) : error LNK2019: unresolved external symbol
> _WinMain@16 referenced in function _WinMainCRTStartup
> main.exe : fatal error LNK1120: 1 unresolved externals
>
>
- Next message: Anthony C: "RE: capturing mouse and keyboard events on WM2003"
- Previous message: Andrew McGrath: "Re: How to run a program automatically when the device is started up"
- In reply to: Min Sheng Lu: "Linker cannot find WinMain() in object"
- Next in thread: Min Sheng Lu: "Re: Linker cannot find WinMain() in object"
- Reply: Min Sheng Lu: "Re: Linker cannot find WinMain() in object"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|