static library (*.a) 를 사용해서 static library (*.a) 를 만드는 것이 불가능 한가요?
글쓴이: jmbae940 / 작성시간: 월, 2010/08/16 - 10:24오후
static library 를 ar 로 또 다른 이름을 가진 static library 를 만들려고 합니다.
아래 명령으로 lib2.a 라는 것을 만든 후에
ar rcs libadd2.a libadd.a
아래 명령으로 실행 파일을 만들었습니다.
g++ -o exe main.cpp -L. -ladd2
아래와 같은 에러가 나더군요.
./libadd.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
여러개의 .a file을 ar을 사용하여 하나의 .a 로 만들수는 없는 건가요?
Forums:
ar x libadd.a ar rcs
ar x libadd.a
ar rcs libadd2.a *.o
풀고 다시 묶으시면 될듯한데요.
------식은이 처------
길이 끝나는 저기엔 아무 것도 없어요. 희망이고 나발이고 아무 것도 없어.
저도 직접 테스트는 해보지 않았지만?
그냥 느낌상으로는
archive file의 object index table 에 오브젝트 파일의 목록이 추가되지 않았기 때문은 아닐까요?
아래 명령어 참조해서 해결해 보세요.그러고 보니 제가 한말이 모두 에러 메시지에 있는 내용이네요.
해결되면 저도 알려주세요. 저도 모르는 내용이라. 그럼.
NAME
ranlib - regenerate archive symbol table
SYNOPSIS
ranlib archive ...
DESCRIPTION
ranlib regenerates the symbol tables of the specified archives. It is
equivalent to executing ar qs archive on each of the archives. After
using the z modifier of ar, the symbol table of an archive must be
regenerated before it can be used.
댓글 달기