0

I am trying to build the library on Windows with CMake. The whole process is new to me, so please excuse this basic question. I followed the instructions under 2.1.2 of the current open62541 manual (Release 1.2.0-rc2-45-gf4270ceb). After executing cmake.exe, I got the following error:

<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 German sentence towards the end translates to The system cannot find the specified file.

I have found several files called MSBuild.exe on my computer and added them all to the PATH environment. This has not resolved the issue.

I tried using the prebuilt single files, but as far as I understand, these are for Linux systems and can not be used with Windows, correct?

Any inputs how I can proceed to obtain a working build are highly appreciated. Thanks!

[Edit:] I was able to continue the build process by doing two things:

  • Changed the Visual Studio Version to the current one in the command (Visual Studio 16 2019)
  • Installed the Windows 10 SDK in Visual Studio as shown here.

Now I am stuck at the step where is says in the manual "Then open buildopen62541.sln in Visual Studio 2015 and build as usual." Any hints what exactly I am supposed to do?

Dave
  • 171
  • 2
  • 13
  • 1
    Have you checked [that question](https://stackoverflow.com/questions/44478492/cmake-failed-to-run-msbuild-command-msbuild-exe/47258066) about the same error message and its answers? The option `-G "Visual Studio 14 2015"` means to configure the project for Visual Studio 14. Do you have Visual Studio of **exactly that version**? – Tsyvarev Oct 07 '21 at 08:23
  • Thank you. In the meantime I was able to solve it based on inputs from that question. See my edit for details. – Dave Oct 07 '21 at 11:34
  • 1
    Invocation of `cmake` creates a solution file `buildopen62541.sln`. You need to run your Visual Studio and open that file in it. – Tsyvarev Oct 07 '21 at 11:36
  • Thanks. I did that, but I am unsure if the process was successful. Is it normal that I don't see anything happening in VS? – Dave Oct 07 '21 at 12:19

1 Answers1

0

To run Visual Studio on an .sln file means to open it in VS, then click on Build in the menu bar and then on Build solution. This was new for me, thanks everyone for hinting me in the right direction.

Dave
  • 171
  • 2
  • 13