gcc에서 -include
컴파일러 플래그를 사용하여 파일의 맨 위에 헤더 파일을 넣을 수 있다는 것을 알고 있지만 끝에 헤더 파일을 포함 할 수는 있습니다 파일의 다른 헤더 파일 선언들. 예를 들어 C 소스 파일에 다음과 같은 선언문이 있습니다.컴파일러에서 소스 파일에 헤더 파일을 넣는 방법
#include "a.h"
#include "b.h"
나는 모든 *.h
파일에
-include a.h -include b.h -include inserted.h
추가 헤더 보호 (이 있어야 사용
#include "a.h"
#include "b.h"
#include "inserted.h"
보다는
#include "inserted.h"
#include "a.h"
#include "b.h"
왜 것 너 (이제까지) 이걸하고 싶어? – unwind
@unwind - 소스 파일을 그대로 둡니다. – MetallicPriest
왜 원본 파일을 그대로 두어야합니까? '#include "inserted.h"를 추가하면 어떻게 문제가 해결되지 않습니까? http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem –