What does Understand need to analyze accurately?¶
Understand reads your source the way a compiler does. It doesn't run your build, but to resolve names, cross-references, types, and control flow correctly it needs the same context your compiler has. The more of that context you give it, the more its analysis matches your compiled code.
The inputs that determine accuracy¶
- Source files. The code itself — the more complete the file set, the fewer unresolved references.
- Include / import paths. Where headers and imported modules live. Missing paths lead to unresolved types and missing relationships.
- Macros and compiler settings. Preprocessor definitions decide which
#ifdefbranches are active. If a macro isn't defined, the wrong branch is parsed and code shows as inactive. - Language / compiler variant. The dialect and standard (e.g. the C++ standard, Fortran fixed vs free form) so the parser matches your toolchain.
Why it matters¶
When context is missing, you'll see the classic symptoms:
- Chunks of inactive code that should have been parsed.
- The same entity appearing multiple times, with some references unresolved.
- Missing entities and edges in graphs, references, and metrics.
To track these symptoms down, see Fix parse errors.
The reliable way to supply it: capture your real build¶
Instead of listing includes and macros by hand, derive them from how your code actually compiles:
- CMake — import
compile_commands.json. See Build from a CMake project. - Visual Studio / Xcode — import the solution or project during the wizard.
- Any build — watch a clean build and capture exact per-file flags. See Build Watcher vs Buildspy.
For the C/C++ specifics — Strict vs Fuzzy parsing and fixing includes and macros — see Create an accurate C/C++ project.
Note
Non-C/C++ languages (Java, C#, Python, Ada, Fortran, …) have their own accuracy inputs — mostly import/classpath/search paths and the language version. The same principle holds: give Understand the paths and version your build uses.
Where to configure it¶
The New Project Wizard offers to import a build when it detects one.
Afterwards, tune everything under Project → Configure Project (includes, macros, imports,
language versions, and file filters). Every project setting is also scriptable — see the
und settings reference.