-Xlinker --start-group 그러나, undefined reference to 에러가 계속 뜨는데요...
컴파일 시, 아래와 같은 에러가 계속 발생합니다.
"undefined reference to" 에러여서, 게시판을 참고하고
아래처럼 바꾸어 보았지만, 차이가 없네요..
컴파일 :
gcc -o myprog myprog.c \
-L/mylib \
-I/myinc \
-Xlinker --start-group \
log.o \
aaa.o \
bbb.o \
ccc.o \
ddd.o \
dbconnect.o \
util.o \
-lnsl -lsqlplus \
-Xlinker --end-group \
에러:
aaa.o(.text+0x785): In function `AAA':
: undefined reference to `ERR_MSG'
aaa.o(.text+0x796): In function `AAA':
: undefined reference to `ERR_MSG'
aaa.o(.text+0x1414): In function `AAA':
: undefined reference to `ERR_MSG'
aaa.o(.text+0x1425): In function `AAA':
: undefined reference to `ERR_MSG'
bbb.o(.text+0x212b): In function `BBB':
: undefined reference to `ERR_MSG'
bbb.o(.text+0x213c): more undefined references to `ERR_MSG' follow
collect2: ld returned 1 exit status
objdump 를 통해서, 해당 목적파일을 열어보면, (예: bbb.o)
컴파일 시에 에러를 뿌린 라인들을 볼 수 있고,
상단에서 *UND* 처럼 된 것을 볼 수 있었습니다.
어떻게 접근하면 될까요?
00000000 *UND* 00000000 ERR_MSG
....
0000212b R_386_32 ERR_MSG
00002130 R_386_PC32 strcpy
0000213c R_386_32 ERR_MSG
....
댓글 달기