简体   繁体   English

Windows Store认证套件-C ++库验证问题

[英]windows store certification kit - c++ library validation issues

I'm trying to port a c++ library to universal windows for a windows store app. 我正在尝试将c ++库移植到Windows应用商店的通用Windows中。 Using x86 developer command prompt in visual studio 2015 v14.0.24720.00 update 1 on Windows 10. 在Windows 10上的Visual Studio 2015 v14.0.24720.00更新1中使用x86开发人员命令提示符。

Wondering what I'm doing wrong - everything compiles and links fine with the following flags: 想知道我在做什么错-一切都可以编译和链接,带有以下标志:

cl /nologo /FoBuild\\Obj\\Windows\\Release\\[OBJ_FILE].obj /c /MD /Ox /W4 /EHsc /FRBuild\\Obj\\Windows\\Release\\ -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -D_CRT_SECURE_NO_WARNINGS -DDEFINE_WINDOWS_UNIVERSAL /AI "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\lib\\store\\references" /WX /ZW /D "WINAPI_FAMILY=2" -IBuild\\Include [SOURCE].cpp

and: 和:

link /nologo /opt:ref /map Ws2_32.lib /APPCONTAINER /dll /out:Build\\Obj\\Windows\\Release\\myDll.dll [OBJ_FILE.obj]*

Getting a whole bunch of unusual looking wack validation errors for things that surely should be standard functions such as malloc and std::bad_alloc etc. And furthermore, a lot of these not supported APIs seem to actually exist in the whitelist files even though they are declared not supported. 对于肯定应该是标准函数(例如malloc和std :: bad_alloc等)的东西,出现了一堆异常的异常验证错误。此外,尽管这些白名单文件中有许多不支持的API似乎确实存在于白名单文件中声明不支持。 Not sure what I'm doing wrong as it all compiles fine with the /ZW /EHsc /D "WINAPI_FAMILY=2" switches as documented here https://msdn.microsoft.com/en-us/library/hh700130.aspx 不知道我在做什么错,因为使用/ ZW / EHsc / D“ WINAPI_FAMILY = 2”开关都可以正常编译,如此处记录的https://msdn.microsoft.com/zh-cn/library/hh700130.aspx

The documentation on that page states explicity that any use of CRT functions that are not allowed in a Windows 8.x Store app will cause a compile-time error when you use the /ZW flag. 该页面上的文档明确指出,在使用/ ZW标志时,Windows 8.x Store应用程序中不允许的任何CRT功能使用都会导致编译时错误。 It all compiles fine, even on the arm toolchain. 即使在手臂工具链上,也可以很好地编译。

Also puzzled as to why some of the refs are in vcruntime140 and some are in api-ms-win-crt-*.dll. 还困惑为什么有些引用在vcruntime140中,而有些在api-ms-win-crt-*。dll中。

Can anyone shed any light on these issues please? 任何人都可以在这些问题上阐明什么吗?

Full list of errors below. 错误的完整列表如下。

Cheers 干杯

Iain 伊恩

◦API _time64 in api-ms-win-crt-time-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _cexit in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _crt_atexit in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _execute_onexit_table in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _initialize_narrow_environment in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _initialize_onexit_table in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _initterm in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _initterm_e in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _invalid_parameter_noinfo_noreturn in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _register_onexit_function in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _seh_filter_dll in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API abort in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API terminate in api-ms-win-crt-runtime-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _strdup in api-ms-win-crt-string-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API strncat in api-ms-win-crt-string-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API strncmp in api-ms-win-crt-string-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API strncpy in api-ms-win-crt-string-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API __acrt_iob_func in api-ms-win-crt-stdio-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API __stdio_common_vfprintf in api-ms-win-crt-stdio-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API __stdio_common_vsnprintf_s in api-ms-win-crt-stdio-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API __stdio_common_vsprintf in api-ms-win-crt-stdio-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API fflush in api-ms-win-crt-stdio-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API _callnewh in api-ms-win-crt-heap-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API calloc in api-ms-win-crt-heap-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API free in api-ms-win-crt-heap-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API malloc in api-ms-win-crt-heap-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API rand in api-ms-win-crt-utility-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API srand in api-ms-win-crt-utility-l1-1-0.dll is not supported for this application type. myDll.dll calls this API.
◦API ?InitializeData@Details@Platform@@YAJH@Z in vccorlib140.dll is not supported for this application type. myDll.dll calls this API.
◦API ?UninitializeData@Details@Platform@@YAXH@Z in vccorlib140.dll is not supported for this application type. myDll.dll calls this API.
◦API _CxxThrowException in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API __CxxFrameHandler3 in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API __std_exception_copy in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API __std_exception_destroy in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API __std_terminate in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API __std_type_info_destroy_list in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API __telemetry_main_invoke_trigger in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API __telemetry_main_return_trigger in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API __vcrt_InitializeCriticalSectionEx in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API _except_handler4_common in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API _purecall in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API memcpy in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API memmove in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API memset in vcruntime140.dll is not supported for this application type. myDll.dll calls this API.
◦API ?_Xbad_alloc@std@@YAXXZ in msvcp140.dll is not supported for this application type. myDll.dll calls this API.
◦API ?_Xlength_error@std@@YAXPBD@Z in msvcp140.dll is not supported for this application type. myDll.dll calls this API.
◦API ?_Xout_of_range@std@@YAXPBD@Z in msvcp140.dll is not supported for this application type. myDll.dll calls this API.
◦API CreateEventA in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API CreateEventW in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API CreateSemaphoreA in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API GetModuleHandleW in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API InitializeCriticalSection in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API SetUnhandledExceptionFilter in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API TerminateProcess in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API TlsAlloc in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API TlsFree in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API TlsGetValue in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API TlsSetValue in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API UnhandledExceptionFilter in kernel32.dll is not supported for this application type. myDll.dll calls this API.
◦API WaitForSingleObject in kernel32.dll is not supported for this application type. myDll.dll calls this API.

The answer is that I needed to build against vs2013 toolchain for windows 8.1 library, not vs2015. 答案是我需要针对Windows 8.1库而不是vs2015构建vs2013工具链。 Don't forget to check the dependency on universal c++ runtime in your app dependencies as well or it will fail to load the dll. 不要忘记在应用程序依赖项中检查对通用c ++运行时的依赖项,否则它将无法加载dll。

use vcvars.bat in C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC 在C:\\ Program Files(x86)\\ Microsoft Visual Studio 12.0 \\ VC中使用vcvars.bat

Compiler: 编译:

cl /nologo /FoBuild\\Obj\\Windows\\Release\\MyObj.obj -c /MD /Ox /c /W4 /EHsc /FRBuild\\Obj\\Windows\\Release\\ -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -DDEFINE_WINDOWS_UNIVERSAL -D_CRT_SECURE_NO_WARNINGS /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /FU"C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1\\ExtensionSDKs\\Microsoft.VCLibs\\12.0\\References\\CommonConfiguration\\neutral\\platform.winmd" /FU"C:\\Program Files (x86)\\Windows Kits\\8.1\\References\\CommonConfiguration\\Neutral\\Windows.winmd" /FU"C:\\Program Files (x86)\\Windows Kits\\8.1\\References\\CommonConfiguration\\Neutral\\Windows.winmd" /WX /ZW /ZW:nostdlib /D "WINAPI_FAMILY=WINAPI_FAMILY_APP" /D " WRL_NO_DEFAULT_LIB " /Gy /Zc:inline /Zc:wchar_t /TP -IBuild\\Include MySrc.cpp cl / nologo /FoBuild\\Obj\\Windows\\Release\\MyObj.obj -c / MD / Ox / c / W4 / E4 D“ _UNICODE” / D“ UNICODE” / FU“ C:\\ Program Files(x86)\\ Microsoft SDKs \\ Windows \\ v8.1 \\ ExtensionSDKs \\ Microsoft.VCLibs \\ 12.0 \\ References \\ CommonConfiguration \\ neutral \\ platform.winmd” / FU “ C:\\ Program Files(x86)\\ Windows Kits \\ 8.1 \\ References \\ CommonConfiguration \\ Neutral \\ Windows.winmd” / FU“ C:\\ Program Files(x86)\\ Windows Kits \\ 8.1 \\ References \\ CommonConfiguration \\ Neutral \\ Windows。 winmd“ / WX / ZW / ZW:nostdlib / D” WINAPI_FAMILY = WINAPI_FAMILY_APP“ / D” WRL_NO_DEFAULT_LIB “ / Gy / Zc:inline / Zc:wchar_t / TP -IBuild \\ Include MySrc.cpp

Linker: 链接:

link /nologo /OPT:REF /map Ws2_32.lib kernel32.lib /APPCONTAINER /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /SUBSYSTEM:WINDOWS /LIBPATH:"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\lib\\store" /dll /out:Build\\Obj\\Windows\\Release\\myDll.dll [Build\\Obj\\Windows\\Release*.obj] 链接/ nologo / OPT:REF / map Ws2_32.lib kernel32.lib / APPCONTAINER / DYNAMICBASE / NXCOMPAT / MACHINE:X86 / SUBSYSTEM:WINDOWS / LIBPATH:“ C:\\ Program Files(x86)\\ Microsoft Visual Studio 12.0 \\ VC \\ lib \\ store“ / dll /out:Build\\Obj\\Windows\\Release\\myDll.dll [Build \\ Obj \\ Windows \\ Release * .obj]

See also: 也可以看看:

https://social.msdn.microsoft.com/Forums/en-US/b4d0ca1a-6b35-49e2-9074-886cc36f80d4/uwpc-store-apps-compiling-c-library-on-command-line-causes-rejections?forum=wpdevelop https://social.msdn.microsoft.com/Forums/en-US/b4d0ca1a-6b35-49e2-9074-886cc36f80d4/uwpc-store-apps-compiling-c-library-on-command-line-causes-rejections?论坛= wpdevelop

https://blogs.msdn.microsoft.com/vcblog/2012/09/28/c-runtime-for-windows-8-store-apps/ https://blogs.msdn.microsoft.com/vcblog/2012/09/28/c-runtime-for-windows-8-store-apps/

Cheers Iain 干杯伊恩

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM