Azure IOT 错误LNK2019:函数IoTHubClient_LL_UploadToBlob_step1and2



我正在学习如何使用Azure IOT-hub与Windows上的C++一起使用。

对于我的示例,我从Visual Studio 2017中的"管理NuGet Packages"下载了以下内容

Microsoft.Azure.C.SharedUtility 
Microsoft.Azure.IoTHub.IoTHubClient 
Microsoft.Azure.IoTHub.HttpTransport

我有一个示例C++代码文件,其中包含以下物联网文件。

#include <future>
#include <time.h>
#include "azure_c_shared_utility/platform.h"
#include "iothub_client.h"
#include "iothubtransporthttp.h"

在C++代码中,我只添加了以下行

std::string connStr = " . . .";
IOTHUB_CLIENT_HANDLE iothubclienthHandle;
if (platform_init() != 0)
{
    printf("Failed initializing IOT platform.rn");
    return;
}
iothubclienthandle = IoTHubClient_CreateFromConnectionString(connStr.c_str(), HTTP_Protocol);
if (iothubclienthandle == nullptr)
{
    printf("Failed IoTHubClient_Creatern");
}

但是在构建时,它给了我链接器错误:

error LNK2019: unresolved external symbol json_parse_string referenced in function IoTHubClient_LL_UploadToBlob_step1and2

我还需要在Visual Studio项目中包含哪些文件/库来解决此问题?

问题似乎出在 1.2.2 版本的 sdk 上。我采用了旧版本的 1.1.32,它编译得很好。

最新更新