Apax test fails with the error fatal error stdio.h file not found

0
Hello everyone, I have a problem with Simatic AX. When I called the command “apax test” for unit testing, the error “fatal error: ‘stdio.h’ file not found” was displayed.   How can I fix this?  
asked
3 answers
6

Hi Rene,

 

This might be due to two things:

1. Please first check whether you have installed the required software component (VS Build Tools). The best way to do this is via the Windows settings and then under installed apps. Search for “Build”, then the “Visual Studio Build Tools” should be displayed. Like this:WindowsAppInstalledVSBuildTools.png

 

Another possibility is to check whether the following path exists: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools

May you have a little different path, if you have a newer Visual Studio version used.

 

If you don't get a result, you have to install the VS Build Tools. To do this, you need administrator rights on your PC. For testing and debugging with AXUnit, you need parts of the VS Build Tools. You can find the best way to install them here: Documentation | SIMATIC AX You don't need the whole VS Build Tools, but only parts of it. The easiest way to add these is to use the Silent Installer.

 

2. If the VS Build Tools are installed, the system may not find the correct installation location of the VS Build Tools. Therefore, you have to add an entry to the system variables so that AX Unit knows.

To do this, you will need administrator rights again. Proceed as follows on Windows 11:

  1. Launch “Settings”
  2. Go to “System”
  3. Go to “Info” on the bottom
  4. Click on "Advanced system settings" link
  5. Click on “Environment variables” on the bottom
  6. Choose “System” variables as you require
  7. To add a new environment variable: Choose “New”
  8. Add new variable (Name: "VCToolsInstallDir, Value in my case, depend on installed version: "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133")

After that, the result should look like this

VSbuildToolsVarEntry.png

 

For more information on the error message, see also the AX documentation: Documentation | SIMATIC AX

answered
3

Hi Rene,

 

this error usually appears, if you don’t have installed all the needed prerequisites, especially dotnet runtimes. Please make sure to install the dotnet runtimes 6 and 8 according to the documentation:

https://console.simatic-ax.siemens.io/docs/get-started/prerequisites

Best,

Thomas

answered
0

Thanks everybody for the fast and extensive answer! 

answered