문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top