首页 文章

Azure IOT错误LNK2019:函数IoTHubClient_LL_UploadToBlob_step1and2中引用的未解析的外部符号json_parse_string

提问于
浏览
0

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

对于我的示例,我从Visual Studio 2017中的“管理NuGet包”下载了一些内容

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

我有一个示例C代码文件,其中包含以下iot文件 .

#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.\r\n");
    return;
}

iothubclienthandle = IoTHubClient_CreateFromConnectionString(connStr.c_str(), HTTP_Protocol);
if (iothubclienthandle == nullptr)
{
    printf("Failed IoTHubClient_Create\r\n");
}

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

error LNK2019: unresolved external symbol json_parse_string referenced in function IoTHubClient_LL_UploadToBlob_step1and2

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

1 回答

  • 0

    似乎问题是1.2.2版本的sdk . 我拿了旧版本1.1.32并且编译得很好 .

相关问题