gcc 에러좀 봐 주세요.
gcc 에러좀 봐 주셨으면 합니다.
에러는 다음과 같고요.
make를 통해 컴파일한 프로그램입니다.
gcc 버전은 3.4.6이고 리눅스는 젠투를 쓰고 있습니다.
컴파일 화면은
make[1]: Entering directory `/data/home/shim1331/nw/src'
gcc-3.4.6 -c -g -O -Wall -march=prescott comm.c
자식프로세스 0x0807f290 (comm.o) PID 26240을(를) 체인에 넣습니다.
살아있는 자식 프로세스 0x0807f290 (comm.o) PID 26240
In file included from comm.c:29:
utils.h:42: warning: conflicting types for built-in function 'log'
In file included from comm.c:30:
comm.h:77:2: invalid preprocessing directive #ef
In file included from comm.c:30:
comm.h:79: error: conflicting types for 'fcntl'
comm.h:79: note: a parameter list with an ellipsis can't match an empty parameter name list declaration
/usr/include/fcntl.h:76: error: previous declaration of 'fcntl' was here
comm.h:79: error: conflicting types for 'fcntl'
comm.h:79: note: a parameter list with an ellipsis can't match an empty parameter name list declaration
/usr/include/fcntl.h:76: error: previous declaration of 'fcntl' was here
comm.h:138:24: warning: no newline at end of file
comm.c: In function `update_blood':
comm.c:857: warning: use of cast expressions as lvalues is deprecated
comm.c: In function `make_prompt':
comm.c:1208: warning: suggest explicit braces to avoid ambiguous `else'
comm.c:1214: warning: suggest explicit braces to avoid ambiguous `else'
comm.c:1219: warning: suggest explicit braces to avoid ambiguous `else'
comm.c: In function `send_to_arena':
comm.c:2138: warning: left shift count >= width of type
실패한 자식 프로세스 0x0807f290 PID 26240 을(를) 거둬들입니다
make[1]: *** [comm.o] 오류 1
Removing child 0x0807f290 PID 26240 from chain.
make[1]: Leaving directory `/data/home/shim1331/nw/src'
실패한 자식 프로세스 0x08086cb8 PID 26239 을(를) 거둬들입니다
make: *** [default] 오류 2
Removing child 0x08086cb8 PID 26239 from chain.
인대 헤더를 살펴보면 다음과같이 정의되어 있습니다.
#ifndef fcntl
int fcntl();
그리고 #endif로 마무리
좀더 많은 정보가 필요하시면 gmail shim11161로 메일 보내주셔도 되고요.
지금 이것때문에 정말 골치가 아프네요.
예전 gcc-3.3.6 때는 안그랬는대.
실행파일 용량도 전에는 2.2mb였는대 새로 컴파일 된거는 1.1mb정도이니
당장 이것만 봐도 오타로 인한 사소한 오류 같은데요.
컴파일 관련한 질문을 보면 과연 얼마나 컴파일러의 에러 메시지와 씨름을 하고 올리는 것인가
하는 생각이 종종 듭니다. 컴파일러의 버그나 혹은 C/C++ 규약상의 미흡한 점 등을 질문을 통해 배운적도
있긴 합니다만 극히 드물 따름이지요.
그냥 살짝 훑어보니 'comm.h:77:2: invalid preprocessing directive #ef' 이런 게 보이네요.
#ef가 뭘 쓰시다가 오타가 난 것인지는 모르겠으나 이런류의 오류는 컴파일러의 에러/워닝 메시지만
하나하나 찾아서 해결하시면 됩니다. 하나씩 소스의 해당 라인을 보시고 스스로 해결해 보시지요.
댓글 달기