【问题标题】:Failure to build open62541 with CMake on Windows在 Windows 上使用 CMake 构建 open62541 失败
【发布时间】:2021-11-27 07:06:47
【问题描述】:

我正在尝试使用 CMake 在 Windows 上构建库。整个过程对我来说是新的,所以请原谅这个基本问题。我按照当前 open62541 手册(版本 1.2.0-rc2-45-gf4270ceb)的 2.1.2 下的说明进行操作。执行cmake.exe后出现如下错误:

<path-to>\open62541\build>"C:\Program Files\CMake\bin\cmake.exe" .. -G "Visual Studio 14 2015"
-- Selecting Windows SDK version  to target Windows 10.0.19043.
CMake Error at CMakeLists.txt:5 (project):
  Failed to run MSBuild command:

    MSBuild.exe

  to get the value of VCTargetsPath:

    Das System kann die angegebene Datei nicht finden



-- Configuring incomplete, errors occurred!

最后的德语句子翻译为The system cannot find the specified file

我在我的计算机上找到了几个名为 MSBuild.exe 的文件,并将它们全部添加到 PATH 环境中。这还没有解决问题。

我尝试使用预构建的单个文件,但据我了解,这些是针对 Linux 系统的,不能与 Windows 一起使用,对吗?

非常感谢我如何继续获得工作构建的任何输入。谢谢!

[编辑:]我能够通过做两件事来继续构建过程:

  • 在命令中将 Visual Studio 版本更改为当前版本 (Visual Studio 16 2019)
  • 在 Visual Studio 中将 Windows 10 SDK 安装为 shown here

现在我被困在手册中所说的步骤“然后在 Visual Studio 2015 中打开 buildopen62541.sln 并照常构建。”任何提示我到底应该做什么?

【问题讨论】:

  • 您是否检查过that question 相同的错误消息及其答案?选项 -G "Visual Studio 14 2015" 表示为 Visual Studio 14 配置项目。您是否拥有 正是该版本的 Visual Studio?
  • 谢谢。与此同时,我能够根据该问题的输入来解决它。有关详细信息,请参阅我的编辑。
  • 调用cmake 会创建一个解决方案文件buildopen62541.sln。您需要运行 Visual Studio 并在其中打开该文件。
  • 谢谢。我这样做了,但我不确定这个过程是否成功。我没有看到 VS 中发生任何事情是正常的吗?

标签: c windows cmake build open62541


【解决方案1】:

.sln 文件上运行Visual Studio 意味着在VS 中打开它,然后单击菜单栏中的Build,然后单击Build solution。 这对我来说是新的,感谢大家提示我正确的方向。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-25
    • 2019-06-09
    • 2018-11-18
    • 2020-02-06
    • 2020-01-13
    • 1970-01-01
    • 2016-07-26
    • 1970-01-01
    相关资源
    最近更新 更多