Windows Embedded Compact 7 SDK issues RRS feed

  • Question

  • SDK built for Windows Embedded Compact 7 has these two issues. I tried this for ARM and SH4 platforms. This is new with WinCE 7, please fix this problem or provide suggestions on how to fix these issues.

    1. stdlib.h

    error C2065: '_malloca' : undeclared identifier C:\Program Files\Windows CE Tools\SDKs\BeagleBoard-xM WEC7SDK\include\ARMv4I\stdlib.h

    This problem is fixed by commenting out line 146 in stdlib.h like this

    //_CRT_BANNED_DEPRECATE(_malloca and _freea) __checkReturn __bcount(_Size) void * __cdecl _alloca(__in size_t _Size);

    2. wchar.h
    C:\Program Files\Windows CE Tools\SDKs\BeagleBoard-xM WEC7SDK\include\ARMv4I\wchar.h(99) : error C2733: second C linkage of overloaded function 'wmemchr' not allowed

    This problem is fixed by protecting the wmemchr like this

    #ifdef __cplusplus
    extern "C++" {
    inline wchar_t *wmemchr(wchar_t *_S, wchar_t _C, size_t _N)
            {return ((wchar_t *)wmemchr((const wchar_t *)_S, _C, _N)); }
    Wednesday, August 3, 2011 11:58 PM

All replies

  • I too have encountered issue 1, error C2065: '_malloca' ...  I found that this error exists even on the compilation of an empty file.  I suspect a problem in my project settings, but the exact fix has been elusive.

    My work-around was to add #include <stdlib.h> to the top of each .cpp file. 

    Monday, August 8, 2011 9:57 PM
  • We noticed the obvious bug in stdlib.h back in a CTP release of CE7 and officially reported the bug via Connect (back when Connect would take bug reports for CE7 CTP) on 1/26/2011.  Has not been fixed yet.  

    We hacked around the bug.  We auto-generate our SDK via a build script so on that clean build machine (that we re-image back to a clean Win7 install daily) we put in a kludge to modify the file   C:\WinCE700\public\Common\sdk\inc\stdlib.h    before we generate the nk.bin and SDK from that image.  Grody but it works.

    Btw we do the modification to simply delete the obviously bogus part

    > _CRT_BANNED_DEPRECATE(_malloca and _freea)


    not the whole line - we still need the export of the _alloca() function.

    We did discover another issue of .h file incompatibility between CE7 and VS2008 with SDK's on the exports of 64 bit string functions, so we also hack the stdlib.h file to comment out those lines before generating the SDK.  Here's the comments from my build script of what we do.    We cannot find a way to submit this bug - it's really a bug in the VS2008 SmartDevice .h file support, not in CE7, but VS2008 is not accept bug reports.  Sigh.

    #Microsoft VS2008 altcecrt.h file has incorrect prototypes on functions wcstoi64, wcstoui64, strtoi64, strtoui64

    # in that the second parameter is supposed to be an OUT but altcecrt.h has it as an IN.

    # CE6 SDK doesn't have these functions prototyped so no conflict. CE7 does prototype them, correctly, which conflicts with the wrong

    # prototypes in altcecrt.h and causes compiler warnings (and we believe in treatWarningsAsErrors).

    # Since these are all 64-bit functions which we don't call on CE, going to just comment out those 4 lines as well in stdlib.h.

    # Only other option is to have every dev fix their VS2008 include file which is WAY too much hassle when we never call these functions in CE7

    Hope that helps

    Sue Wolber

    Agilent Technologies


    Friday, August 26, 2011 9:38 PM
  • This is a known issue that was fixed in the most recent software update for Windows Embedded Compact 7. For more information, see Windows Embedded Compact 7 - Update 3 on MSDN:
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, October 20, 2011 7:19 PM