Share via


CRT and C++ Differences from Windows Desktop (Compact 2013)

10/26/2015

This section provides an overview of how the CRT and C++ libraries in Windows Embedded Compact 2013 differ from the CRT and C++ libraries in Windows desktop. For complete documentation of the CRT and C++ libraries included with Visual Studio 2013 and Visual Studio 2015, see the following sources on MSDN:

Console input and output

Compact 2013 does not support input or output to a console. This affects the functions listed in the following table.

Function

Impact

stdin, stdout, stderr

Not supported

_dup, _dup2

Supports file input/output only.

freopen, freopen_s, _wfreopen, _wfreopen_s

Does not support the keyword CON (redirect back to console)

Static CRT linking

Compact 2013 does not static links to CRT libraries. This affects the functions listed in the following table.

Function

Impact

__getmainargs, __wgetmainargs

These functions must be linked with the setargv.obj or Wsetargv.obj file in order to operate correctly. For more information about these files, see Expanding Wildcard Arguments on MSDN.

_CrtDbgReportW in debug builds only

The function _CrtDbgReportW is available only when you build an OS design in the debug configuration. This function has the following return values:

  1. In OS images built with the debug configuration
    • The function outputs a message through OutPutDebugStringW
    • If the report type is set to _CRT_ASSERT, the function starts the debugger. If the report type is set to _CRT_WARN or _CRT_ERROR, the function does not start the debugger.
    • The function returns 0.
  2. In OS images built with the retail configuration, The function always returns an error (-1).

Per-thread locale

Compact 2013 does not support pre-thread locale. This directly affects the function _configthreadlocale, but it may also cause issues in program structure.

Unsupported functions

Compact 2013 does not support the functions in the following list.

  • _chdrive
  • _configthreadlocale (Per thread locale is not supported.)
  • _dupenv_s (also _dupenv_s, _wdupenv_s)
  • _fstat (also _fstat32, _fstat32i64, _fstat64, _fstat64i32)
  • _fullpath (also _fullpath, _wfullpath)
  • _getcwd (also _getcwd, _wgetcwd)
  • _getdcwd (also _getdcwd, _wgetdcwd)
  • _getdiskfree
  • _getdrive
  • _getdrives
  • _open_osfhandle
  • _pipe
  • _putenv (also _putenv, _wputenv)
  • _putenv_s (also _putenv_s, _wputenv_s)
  • _searchenv (also _searchenv, _wsearchenv)
  • _searchenv_s (also _searchenv_s, _wsearchenv_s)
  • _set_doserrno
  • _stat (also _stat32, _stat32i64, _stat64, _stat64i32)
  • _tempnam (also _tempnam, _wtempnam)
  • _wstat (also _wstat32, _wstat32i64, _wstat64, _wstat64i32)
  • getenv (getenv, _wgetenv)
  • getenv_s (getenv_s, _wgetenv_s)

See Also

Other Resources

C and C++ Libraries for Windows Embedded Compact