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
POSTED BY: Michel Oliveira
7 Replies

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

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

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
POSTED BY: Otto Tronarp
POSTED BY: Michel Oliveira
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