Eclipse CDT: Resolving Symbol 'cout'
When attempting to use the cout statement in Eclipse CDT, users may encounter the error "Symbol 'cout' could not be resolved," despite having necessary header files included.
This issue typically occurs when system-specific include directories are missing from the project's settings. Eclipse's indexing feature relies on these directories to properly parse header files. To address this, locate unresolved includes by right-clicking on the project and selecting Index > Search For Unresolved Includes. Search these unresolved includes in /usr/include and add their containing directories to the C Include Paths and Symbols in Project Properties.
For example, on Ubuntu systems, adding /usr/include/c /4.6/x86_64-linux-gnu includes the missing bits/c config.h header, resolving the error.
Remember to rebuild the index via Index > Rebuild after updating the include directories.
The above is the detailed content of Eclipse CDT: Why Can\'t I Resolve the Symbol \'cout\'?. For more information, please follow other related articles on the PHP Chinese website!