Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.1K 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
POSTED BY: Otto Tronarp

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

After a week spent on this I could manage to solve the problem. Actually, the problem was with Visual Studio 2019 installation. For some strange reason, the command VsDevCmd messes with all the needed environmental variables to do a proper compilation. It is something related with having more than one version of Windows SDK in the computer. It shouldn't be a problem as SM "asked" VS2019 the proper setup to compile its files. The toolkit with all needed headers and libraries is the 10.0.19041.0 version. You can find the toolkits in (if you haven't changed the standard path):

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

There is a folder for each version:

enter image description here

Solution:

  1. Select custom setup for the compiler;
  2. Add -winsdk=10.0.19041.0 command to the line "Visual C++ setup script arguments";
  3. Click Verify Compiler, it is expected to succeed;
  4. Click OK.

My compiler options screen after setup: enter image description here

Hope this helps anyone with the same problem!

Relevant link: https://renenyffenegger.ch/notes/Windows/dirs/Program-Files-x86/Microsoft-Visual-Studio/version/edition/Common7/Tools/VsDevCmd_bat

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