Even a simplest C/C++ program just printing "Hello World" needs to include system headers. Consider:
#include <stdio.h> #include <stdlib.h> int main(void) { puts("!!!Hello World!!!"); return EXIT_SUCCESS; }
Indexer needs to be able to find headers stdio.h and stdlib.h and parse them to provide accurate index. In this example, the headers define prototype of function puts and macro EXIT_SUCCESS.
The Stand-alone Debugger will try to discover include paths and preprocessor symbols automatically. There are 2 main ways to discover those:
The debugger uses Language Settings Providers to discover the settings (starting with version CDT 8.1). Typically Language settings Providers are specialized. One will provide built-in compiler settings and another one settings detected by Build output Parser.
The setting entries found by Scanner Discovery can be inspected in project properties on "Preprocessor Include Paths, Macros etc." page. Each Language Settings Provider can be expanded to show the entries it discovered.
If information retrieved by auto-discovery is insufficient a user can enter additional include paths and macros manually under "User Settings Entries".
The output of built-in compiler specs detectors can be inspected to troubleshoot problems running the command. To do so, enable checkbox "Allocate console in the Console View".
When checkbox "Allocate console in the Console View" is enabled, output of each run of the provider will be directed to a special console in the Console View.
Setting up include paths and macros for C/C++ indexer
C/C++ Preferences: Scanner Discovery
C/C++ Project properties: Preprocessor Include Paths, Macros, etc.