Reputation: 565
I have some existing C++ code that I am editing under eclipse Oxygen. It is reporting errors in the IDE because the original project under a different IDE was configured to include a specified default header file automatically. How can I do this in eclipse.
Not asking how to change a template for a new file.
Do not know how to use -include option as I do not have a make file. Using -include is described in "Is there any way to include a header file in all C or CPP file automatically? "
I cannot see a way to do this under Preferences > C/C++ Build > Settings.
Upvotes: 0
Views: 1481
Reputation: 11
If I understand correctly, you are not building you code with Eclipse but just using the editor,
and the C++ project was probably created with a type Makefile project
without any Toolchain.
In that case I would suggest the following ...
To configure the include path in Eclipse CDT without any toolchain :
Properties
.C/C++ General > Paths and Symbols > Includes > Languages = C++
Index > Rebuild
.Upvotes: 0
Reputation: 11
To configure the include path in Eclipse CDT :
Properties
.C/C++ Build > Settings > Tool Settings > Compiler > Includes
Configuration: [All configurations]
to add the -include option both in Release and Debug mode.C/C++ Build > Build Variables
to use it in the file name (e.g.: "${INSTALL_HOME}/include/global.h")Upvotes: 1