0

I am trying to do simulation using Delmia. This requires a functioning C compiler. When i test my C compiler in Delmia, which tries to compile a very simple source file that includes stdio.h, I get the error "Cannot open include file: 'stdio.h': No such file or directory":

Compiling and linking the model (Visual C++). 

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.6.2
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
Guessed compiler version: 1913  
"Testing 32-bit compilation" 
dsmodel.c
dsmodel.c(1): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory

Error generating Dymosim. 

It seems to be entirely the same issue as:

Visual Studio 2017 for Dymola cannot open stdio.h

His solution is not descriptive enough for me to solve my issue, as his "IT dept" apparently solved it for him, but he mentions allowing access to regedit which I do not understand the reason for in this context.

I have tried to recreate the error that Delmia generates by compiling dsmodel.c with VS2017 Developer Command Promt. If I run the command prompt in Administrator it compiles fine, if I do not, I get the samme error as Delmia outputs. Why is this?

If I find a solution such that I can compile it with command prompt without being in Administrator mode, then should Delmia not also be able to? How can i achieve this?

Some additional information: I have installed Visual Studio not on my main drive, and the Windows SDK is in program files on my main drive. Does this have any relevance?

Edit: For anyone else with this issue in Delmia, I would suggest simply installing another compatible compiler as a work-around. I installed MinGW which works well, even though this additional compiler takes up 500 MB. Remember that it has to be 64-bit. I used the "MingW-W64-builds" from http://mingw-w64.org/doku.php/download

Lars Lort
  • 23
  • 5
  • Two possibilities: [file is not in a place that is being searched for the file] or [file is found but you do not have access]. Based on the error I'm leaning toward the second. First try opening the stdio.h with a text editor (notepad) using the same user and permissions as Delmia. If it does not work, then you need to modify the file (and probably the directory) to be legible by the Delmia user. – Abel May 09 '20 at 18:10
  • Thanks for your suggestion @Abel. I could open/read 'stdio.h' with Notepad++ but not write without administrator rights. Afterwards, I've given all users access to all permission in the entire Windows SDK folder, and I can now read and write without administrator. But still there is no change when attempting a compile without running as administrator. – Lars Lort May 09 '20 at 18:54
  • I would attempt to give Delmia administrator rights, but it has so many different .exe's that I cannot find the one used for C compilation. – Lars Lort May 09 '20 at 18:58
  • Alright that leaves the second possibility: something is different between where Delmia and Administrator are looking for the files. Start by checking both users' INCLUDE and other environment variables https://learn.microsoft.com/en-us/cpp/build/reference/vcpp-directories-property-page?view=vs-2019 – Abel May 09 '20 at 22:00

0 Answers0