комплект сертификации магазина Windows — вопросы проверки библиотеки c ++

Я пытаюсь портировать библиотеку c ++ на универсальные окна для приложения магазина Windows.
Использование командной строки разработчика x86 в Visual Studio 2015 v14.0.24720.00 обновление 1 в Windows 10.

Интересно, что я делаю не так — все компилируется и связывается нормально со следующими флагами:

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

а также:

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

Получение целого ряда необычно выглядящих ошибок валидации для вещей, которые, безусловно, должны быть стандартными функциями, такими как malloc и std :: bad_alloc и т. Д.
Более того, многие из этих неподдерживаемых API-интерфейсов, по-видимому, существуют в файлах белых списков, даже если они объявлены не поддерживаемыми.
Не уверен, что я делаю не так, поскольку все это прекрасно компилируется с ключами / ZW / EHsc / D «WINAPI_FAMILY = 2», как описано здесь https://msdn.microsoft.com/en-us/library/hh700130.aspx

Документация на этой странице гласит, что любое использование функций CRT, которые не разрешены в приложении Магазина Windows 8.x, приведет к ошибке времени компиляции при использовании флага / ZW. Все отлично компилируется, даже на ручном наборе инструментов.

Также озадачено, почему некоторые ссылки находятся в vcruntime140, а некоторые в api-ms-win-crt — *. Dll.

Может кто-нибудь пролить свет на эти вопросы, пожалуйста?

Полный список ошибок ниже.

ура

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.

2

Решение

Ответ заключается в том, что мне нужно было собрать инструментальную библиотеку vs2013 для Windows 8.1, а не vs2015. Не забудьте также проверить зависимость от универсальной среды выполнения c ++ в зависимости вашего приложения, иначе она не сможет загрузить dll.

используйте vcvars.bat в C: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ VC

Составитель:

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_UNINO D «_UNICODE» / D «UNICODE» / FU «C: \ Program Files (x86) \ Microsoft SDKs \ Windows \ v8.1 \ ExtensionSDKs \ Microsoft.VCLibs \ 12.0 \ Ссылки \ CommonConfiguration \ нейтральный \ 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 \ Ссылки \ 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:

ссылка / nologo / OPT: REF / карта \ store «/ dll /out:Build\Obj\Windows\Release\myDll.dll [Build \ Obj \ Windows \ Release * .obj]

Смотрите также:

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/

ура
Iain

0

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]