ghorwin / FMICodeGenerator

A Code Generator that creates native C/C++ code to build Functional Mock-Up Units (FMU) with support for FMI version 2.0 (rollback)
BSD 3-Clause "New" or "Revised" License
51 stars 25 forks source link

The System Cannot Find the Path Specified/CMAKE_Compiler_NOT_SET #56

Closed Number-One-Intern closed 1 month ago

Number-One-Intern commented 2 months ago

Hi, I'm currently just trying to generate P_Control. However, I keep getting an error message exactly like the one described in #53. But I am unsure what to edit in the build_VC_x64.bat. So, I tried to fix it by downloading Visual Studio 2022 and adding nmake to the path but instead I get this error. image image What steps should I take to fix this?

ghorwin commented 1 month ago

Hi, sorry for the late reply, but it's vacation season here :-)

In the batch file, you need to change the line

set VCVARSALL_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"

to match the location of the vcvars64.bat of the 2022 installation.

Usually, the VC installer creates a app/program shortcut called "Visual Studio Command Prompt" -> open the referenced batch file and this should be the path you need to add.

I'll try to install VC2022 on my machine as well and will add a compiler-specific batch file to the repo (sometime later today).

Number-One-Intern commented 1 month ago

Hey, thanks for the response. I hope you are enjoying your vacation. I changed the file as you said, setting the Path to "C:\Program Files\Microsoft Visual\Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" But unfortunately, it seems the errors are still occurring. It is calling the msvc developer prompt now though. image image

ghorwin commented 1 month ago

I've added batch files for VC2019 and VC2022 (the latter being now the default).