Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.5K Views
|
7 Replies
|
7 Total Likes
View groups...
Share
Share this post:

SystemModeler compiler can't find inttypes.h?

Posted 3 years ago

I tried to compile a co-simulation FMU (2.0) and the compiler complains that inttypes.h is missing. The same error ocurred when I try to run any model. Here is the compiler settings: enter image description here

And here is the compiler error:

enter image description here

There is a macro in modelica_types.h: HAVE_INTTYPES_H and seems to me that it is defined somewhere else, so the compiler tries to compile with this header but doesn't find it. I inspected the folder of modelica_types.h but didn't see any inttypes.h.

System:

Product version: 12.3.1.7
Client: Model Center
Client version: 12.3.1.6
Client creation date: 2021-06-07T11:45:13.640000
Client build revisions: S:1b0160c02, J:1dbf5d051, L:38c242434
Client build type: 64 bit
Kernel version: 12.3.1.7
Kernel creation date: 2021-05-27T14:59:37.824000
Kernel build revisions: S:745840ba9, J:84e3d9a4b, L:38c242434
Kernel root directory: C:\Program Files\Wolfram Research\SystemModeler 12.3.1
Installation directory: C:\Program Files\Wolfram Research\SystemModeler 12.3.1
Platform: Windows 10 Version 1909

POSTED BY: Michel Oliveira
7 Replies

You're welcome.

In my HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\MicrosoftSDKs\Windows\v10.0 the version is 10.0.19041. I don't understand why is not 10.0.22000.0 version. Also, the 10.0.19041 folder have more and different stuff than the 10.0.22000.0 folder.

10.0.22000.0 folder: enter image description here

10.0.19041 folder: enter image description here

POSTED BY: Michel Oliveira

I'm glad that you figured it out and thanks for sharing the solution.

That the old 10.0.10240.0 doesn't work isn't that surprising, this was back in the day with VS2015 and then perhaps some of the libraries came with the compiler.

I'm still perplexed by the fact that it doesn't work out of the box for you, if you don't specify -winsdk VsDevCmd.bat is supposed to select the newest as far as I can tell and for you that would be 10.0.22000.0 and that one certainly works for me. According to posts at the Visual Studio community it's supposed to read that information from the registry: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v10.0 You could take a look there and see which version it points to.

Otto

POSTED BY: Otto Tronarp
POSTED BY: Michel Oliveira

Ok, I have confused the 12.1 version of SM with 12.3 version, I had both installed. But I still have the problem. Now in 12.3 version, I checked for compatible compilers and choose visual C++ build tools 2019. Than the main VS screen doesn't offer anything new to install. And the component that you show is installed. It is in portuguese but you can get it.

enter image description here

PS: I have reinstalled SM 12.3 to try to fix it, but didn't work.

EDIT: I've uninstalled all VS packages and I started SM again, it prompted me to set the compiler and it, as always, opens the VS installer (VS 2019). I just installed everything SM pre-selected and the problem still happens.

EDIT 2: I found inttypes.h, is at:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt

I added this path with the /I flag in a custom compiler setting:

enter image description here

After that the error changes: enter image description here

It said that it could not open the file, also in the folders:

C:\Program Files\Wolfram Research\SystemModeler 12.3.1\lib\win64\VS2019

and

C:\Program Files\Wolfram Research\SystemModeler 12.3.1\lib\win64\VS2019\msl\3.2.3

there is no libucrt.lib file.

Does SM need some environmental variables? for itself or for VS2019 tools ? Is there any important stuff that SM requires that should be in the PATH env. var. ?

POSTED BY: Michel Oliveira

The HAVE_INTTYPES_H macro is set because Visual Studio should have the inttypes.h header since VS2013.

Just to make sure did you verify that the selected compiler was changed to you newly installed VS 2017? enter image description here

I've installed the full "Visual C++ build tools" workload for Vs 2017

That is not communicated that clearly, but you are not supposed to change anything during the installation, the necessary components should be preselected.

For me the component that seems to add the inttypes.h file is Windows Universal CRT SDK enter image description here

POSTED BY: Otto Tronarp
POSTED BY: Michel Oliveira

You are most likely missing a necessary component of Visual Build Tools. I would suggest that you install the compiler by pressing the "Check for Compatible Compiler" button in the dialog shown above. This will preselect the necessary components of Visual Studio Build Tools that you need to install.

Otto

POSTED BY: Otto Tronarp
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard