To troubleshoot this issue in Polyspace Code Prover R2024b, inspect the generated Polyspace options file and review the "-I" include path entries used for the external library.
One possible cause is that the Polyspace options file includes "-I" paths for more than one version or copy of the same external library. For example, the options file might include paths similar to:
-I project/ci/external/exampleLib/versionA/exampleLib
-I project/external/exampleLib
If both locations contain headers with the same names but different contents, Polyspace Code Prover may compile against an incompatible set of headers. This can lead to missing namespace member errors even when the expected header files are present somewhere in the project.
Another possible cause is a namespace mismatch inside one version of the external library headers. For example, a header might define "namespace exampleLib" and then define "namespace exampleLib::core" inside it. This can place declarations under "exampleLib::exampleLib::core" instead of the expected "exampleLib::core". Other source files or headers that refer to "exampleLib::core" can then fail during compilation.
To check whether either issue is the root cause:
- Open the generated Polyspace options file.
- Search for "-I" entries that point to the external library.
- Check whether multiple "-I" entries refer to different versions or copies of the same library.
- Compare headers with the same names across those library locations.
- Inspect the affected headers for namespace declarations that could define symbols under a nested namespace such as "exampleLib::exampleLib::core".
- Update the Polyspace analysis configuration so the options file includes only the intended version of the external library.
- Run the Polyspace analysis again.
If duplicate incompatible library versions or namespace mismatches are present, using one consistent version of the external library throughout the Polyspace analysis should resolve the compilation failure.