Share via


Linking to the CRT (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > C Run-time Libraries

The C Run-Time Libraries for Windows CE (CRT) provide many useful functions that can make programming much easier.

The CRT resides in two core libraries, COREDLL.DLL and CORELIBC.LIB.

  • You can link to the portion of the CRT in COREDLL.DLL by linking with COREDLL.LIB, the import library for COREDLL.DLL.
  • CORELIBC.LIB contains the CRT startup routines. In addition, it contains other CRT routines that you must link to statically, primarily to ensure optimum performance.

When you link your image, you explicitly or implicitly specify an entry point that the operating system will call into after loading the image.

For a DLL, the default entry point is _DllMainCRTStartup.

For an EXE, the default entry is wWinMainCRTStartup, the Unicode entry point for an EXE that defines the wWinMain function, or WinMainCRTStartup otherwise.

You can rely on the default entry point that the linker chooses, but the best practice is usually to override the default choice. Instead, specify an entry point with the /ENTRY linker option.

Windows CE supports the following CRT entry points:

  • mainACRTStartup for applications that define the main function
  • mainWCRTStartup for applications that define the wmain function
  • WinMainCRTStartup for applications that define the WinMain function
  • wWinMainCRTStartup for applications that define the wWinMain function
  • _DllMainCRTStartup for DLLs

For more information, see the linker topic /ENTRY (Entry-Point Symbol).

Note   If you want to use mainACRTStartup or mainWCRTStartup, you must explicitly state that when you specify the /ENTRY option.

See Also

Run-Time Library Behavior | WinMain | DllMain

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.