Search Results for 'Precompiled Header'

ATOM Icon

1 POSTS

  1. 2009/12/22 error C1010 by shiftkey

error C1010

fatal error C1010: 미리 컴파일된 헤더를 찾는 동안 예기치 않은 파일의 끝이 나타났습니다. '#include "stdafx.h"'을(를) 소스에 추가하시겠습니까?

위 에러는 Visual Studio의 Precompiled Header 설정때문에 생긴 에러인데

Precompiled Header는 컴파일 하기전에 미리 자주 쓰는 헤더 파일들을
컴파일 해둬서 컴파일 할 때 빠르게 컴파일하려는 것인데
VC++에서 프로젝트를 생성하면 디폴트로 Precompiled Header가 설정된다.

Precompiled Header를 쓰지 않으려면 프로젝트 속성 창에서
"구성 속성 >> C/C++ >> 미리 컴파일된 헤더"의
"미리 컴파일된 헤더 만들기/사용"을 "미리 컴파일된 헤더 사용"을
"미리 컴파일된 헤더 사용 안 함" 또는 "미리 컴파일된 헤더 만들기"로 설정하면 된다.

이 옵션을 변경하지 않고 유지하려면
#include "stdafx.h" 를
해당 .cpp 파일의 맨 위에 선언해주면 된다.
중요한건 위 선언이 다른 include 보다 먼저 선언되어야 하는 것이다.

stdafx.h/cpp는 Precompiled Header설정이 사용하는 것인데
앞서 말한 자주쓰는 헤더파일을 stdafx.h에 선언해두면
stdafx.cpp 파일이 컴파일될 때 Precompiled Header파일을 생성하게 된다.

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by shiftkey

2009/12/22 18:18 2009/12/22 18:18
, ,
Response
No Trackback , No Comment
RSS :
http://shiftkey.org/rss/response/248


블로그 이미지

Shiftkey가 살아가는 이런 저런 이야기......

- shiftkey

Notices

Archives

Authors

  1. shiftkey

Calendar

«   2012/05   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Site Stats

Total hits:
161237
Today:
18
Yesterday:
243