gpt4 book ai didi

azure - 使用 CMake 实用程序构建 Azure IoT 网关 SDK 解决方案

转载 作者:行者123 更新时间:2023-12-03 04:27:56 25 4
gpt4 key购买 nike

我正在尝试使用适用于 Windows 10 平台上的 Visual Studio 2015 的 CMake 3.71 实用程序构建示例 Azure IoT Gateway SDK 项目。当我尝试分别在 VS2015 命令行和 CMake GUI 中构建项目时,我收到以下错误日志:

Determining if the _M_AMD64 exist failed with the following output:
Change Dir: C:/Users/nanos/Documents/GitHub/project/azure-iot-gateway-sdk/build/CMakeFiles/CMakeTmp

Run Build Command:"C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe" "cmTC_23e97.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=14.0"
Microsoft (R) Build Engine version 14.0.25420.1

Copyright (C) Microsoft Corporation. All rights reserved.



Build started 12/6/2016 1:53:03 AM.

Project "C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\cmTC_23e97.vcxproj" on node 1 (default targets).

PrepareForBuild:

Creating directory "cmTC_23e97.dir\Debug\".

Creating directory "C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\Debug\".

Creating directory "cmTC_23e97.dir\Debug\cmTC_23e97.tlog\".

InitializeBuildStatus:

Creating "cmTC_23e97.dir\Debug\cmTC_23e97.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.

ClCompile:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_23e97.dir\Debug\\" /Fd"cmTC_23e97.dir\Debug\vc140.pdb" /Gd /TC /analyze- /errorReport:queue "C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c"

Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24215.1 for x86

Copyright (C) Microsoft Corporation. All rights reserved.



cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_23e97.dir\Debug\\" /Fd"cmTC_23e97.dir\Debug\vc140.pdb" /Gd /TC /analyze- /errorReport:queue "C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c"



CheckSymbolExists.c

C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c(7): error C2065: '_M_AMD64': undeclared identifier [C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\cmTC_23e97.vcxproj]

Done Building Project "C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\cmTC_23e97.vcxproj" (default targets) -- FAILED.



Build FAILED.



"C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\cmTC_23e97.vcxproj" (default target) (1) ->

(ClCompile target) ->

C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\CheckSymbolExists.c(7): error C2065: '_M_AMD64': undeclared identifier [C:\Users\nanos\Documents\GitHub\project\azure-iot-gateway-sdk\build\CMakeFiles\CMakeTmp\cmTC_23e97.vcxproj]



0 Warning(s)

1 Error(s)



Time Elapsed 00:00:00.65


File C:/Users/nanos/Documents/GitHub/project/azure-iot-gateway-sdk/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */

int main(int argc, char** argv)
{
(void)argv;
#ifndef _M_AMD64
return ((int*)(&_M_AMD64))[argc];
#else
(void)argc;
return 0;
#endif
}

================================================== =========================

Output from the CMake GUI here

有人可以告诉我我做错了什么或指导我吗?我花了很多时间试图弄清楚如何解决这个问题。我在网上广泛搜索了解决方案,但没有成功。

提前致谢

最佳答案

好像和这个有关note :

Note: Make sure to clone the repo into a directory heirachy with less than 20 characters (if the path is prefix\azure-iot-gateway-sdk, prefix must be less than 20 characters). Windows has limitations on the length of file names and placing the repo in a hierarchy deeper than 20 characters will cause the build to fail. Our build.cmd script throws an error if it would eventually hit this failure, but one can hit this when manually building the project with cmake.

我杀死目录中的“项目”(...Documents/GitHub/project/azure-iot-gateway-sdk/...),然后它就可以工作了。

因此,您需要缩短将存储库克隆到的目录的长度。

关于azure - 使用 CMake 实用程序构建 Azure IoT 网关 SDK 解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40989776/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com