我正试图用CMake在Windows上构建库。整个过程对我来说都是新的,所以请原谅这个基本问题。我遵循了当前open62541手册(Release 1.2.0-rc2-45-gf4270ceb) 2.1.2下的说明。执行cmake.exe
后,我得到以下错误:
<path-to>open62541build>"C:Program FilesCMakebincmake.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一起使用,对吗?
任何输入如何我可以继续获得一个工作的构建是高度赞赏的。谢谢!
[Edit:]我能够通过做两件事来继续构建过程:
- 在命令(
Visual Studio 16 2019
) 中将Visual Studio版本更改为当前版本 - 在Visual Studio中安装Windows 10 SDK,如图所示。
现在我被困在手册中所说的步骤;然后在Visual Studio 2015中打开buildopen62541.sln
并像往常一样构建。有没有提示我该怎么做?
在.sln
文件上运行Visual Studio意味着在VS中打开它,然后单击菜单栏中的Build
,然后单击Build solution
。这对我来说是新的,谢谢大家在正确的方向上给我提示。