Main Content

Resolve polyspace-autosar Error: Could Not Find Include File

Issue

When creating a Polyspace® project from an AUTOSAR description, by default, the software searches only in the source folder for #include-d files. If an include file is not present directly in the source folder, Polyspace cannot find it. For instance, the missing include file can be in a subfolder of the source folder.

You see a warning like this when creating a Polyspace project from AUTOSAR XML and source files:

Could not find include file "MemMap.h"

If you use variables or functions declared in the missing include file, you can also see errors later.

Possible Solutions

If you want to expand the search path for include files, explicitly add new folders.

You can find the possible include folders to add in several ways:

  • If an include file is in a subfolder of the source code folder, the analysis proposes a resolution hint with one or more include folders that might contain the missing include file. To see the resolution hints, in the file psar_project.xhtml, click the navigation button button on the upper left, then click Behaviors. On the Behaviors tab, below the errors in the code extraction phase, click the link to see a summary of code-extraction diagnostics with possible resolution hints.

    Code extraction errors followed by summary link

    You can see resolution hints, that is, possible include folders to add, that would resolve some of the missing include files.

    Instead of fixing individual code extraction errors using the resolution hints, you can also download a file with all options that implement the hints. On the summary page, click the link Download polyspace-autosar options.

    Location of link to download options that implement resolution hints

    You can use the downloaded text file with the polyspace-autosar option -options-file to implement the resolution hints in one shot.

  • If you use a build command for compilation, you can extract compilation options such as path to includes from your build command. See Run Polyspace on AUTOSAR Code Using Build Command.

You might also simply know the architecture of the system to locate the missing include folders.

See Also

Related Topics