Reputation: 518
I have been working in Visual Studio on a project and had a header file which I included in every other header file using Project Properties -> C/C++ -> Advanced -> Forced Include File. How do I do this in Code Blocks?
Upvotes: 2
Views: 1190
Reputation: 145359
Code::Blocks uses the g++ compiler by default.
With g++ the option to force a header inclusion is -include
file, which you just put in the IDE settings (e.g. right click project, select build options, IIRC).
To find that information I just googled "forced include g++", which landed me at (http://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html), the relevant documentation.
It's often a good idea to consult the documentation, and if that fails, google.
Or as in this case, the opposite order, but anyway, that's a good idea.
Upvotes: 3
Reputation: 153955
Personally I'd use perl
to include the header file in question, e.g., after the first header file in a given file and would run the perl script on all .cpp
files, probably using find
. Put differently: I would change all .cpp
files but not manually (unless there are just a few files involved).
Upvotes: 0