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
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

As soon as I finished SM installation, it prompted me to set a compiler. I let it choose and the first option was VS 2019 version, than a I did as you told, I've clicked in "check for compatible compiler" and it asked me to install VS 2017. I've installed the full "Visual C++ build tools" workload for Vs 2017 and it still fails with the same problem. I couldn't find inttypes.h header in my computer also, I don't now why the macro HAVE_INTTYPES_H is set.

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