Win API系列 - 编译AWS C ++ SDK [英] Win API Family - Compiling AWS C++ SDK
问题描述
我目前正在尝试在Win32应用程序中使用AWS C ++ SDK作为Pi3B。由于链接器错误而导致ARM编译问题,因为头文件忽略了基于WINAPI_FAMILY的代码。
I am currently trying to use the AWS C++ SDK in a Win32 application for a Pi3B. I am having an issue compiling for ARM due to linker errors with header files that are omitting code based on WINAPI_FAMILY.
正在使用.\vcpkg install aws -sdk-构建AWS项目。 cpp:arm-uwp,这将声明WINAPI_FAMILY = WINAPI_FAMILY_APP作为其构建命令行的一部分。
The AWS project is being built using .\vcpkg install aws-sdk-cpp:arm-uwp and this declares WINAPI_FAMILY=WINAPI_FAMILY_APP as part of its build command line.
但是,除非满足以下条件,否则诸如winhttp.h之类的头文件是不可用的:
However header files such as winhttp.h are not useable unless the following is true:
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
从我所看到的,下面的API在onecoreuap.lib中的Win10 IoT上受支持,事实上我可以从我自己的应用程序访问它。
From what I can see the API beneath the above is supported on Win10 IoT in onecoreuap.lib, in fact I can access it from my own app.
查看winapifamily.h使用WINAPI_FAMILY_APP构建的应用程序不会设置WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM,因此排除标题的内容,导致链接问题。
Looking at winapifamily.h an app built with WINAPI_FAMILY_APP will not set WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM and so exclude the contents of the header, causing the link issues.
vcpkg构建是否应指定除WINAPI_FAMILY_APP之外的其他内容,以便能够使用winhttp.h,userenv.h等。?
Should the vcpkg build be specifying something other than WINAPI_FAMILY_APP to be able to use winhttp.h, userenv.h etc.?
谢谢,Mark
推荐答案
除此之外,
在我的C ++控制台应用程序中,使用IoT模板,似乎WINAPI_FAMILY解析为WINAPI_FAMILY_DESKTOP_APP,然后解析为WINAPI_PARTITION_DESKTOP = true,因此头文件包含API。
In my C++ Console App, using the IoT template, it seems that WINAPI_FAMILY resolves to WINAPI_FAMILY_DESKTOP_APP, which then resolves to WINAPI_PARTITION_DESKTOP = true, so the header files include the API.
对于aws构建,WINAPI_FAMILY被设置为WINAPI_FAMILY_APP,重新定义为WINAPI_FAMILY_PC_APP,然后不解析为WINAPI_PARTITION_DESKTOP或WINAPI_PARTITION_SYSTEM。
For the aws build WINAPI_FAMILY is being set to WINAPI_FAMILY_APP, which is redefined as WINAPI_FAMILY_PC_APP which then does not resolve to WINAPI_PARTITION_DESKTOP or WINAPI_PARTITION_SYSTEM.
所以我猜vcpkg构建可能指定了错误姓氏?
So I guess the vcpkg build may be specifying the wrong family name?
马克
这篇关于Win API系列 - 编译AWS C ++ SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!