ncurses 라이브러리는 static link(static build)가 안되나요 ? // gcc -static hello.c -o hello -lncurses 빌드가 안되네요...
글쓴이: ukyoukyo / 작성시간: 금, 2012/12/14 - 1:58오후
CentOS 6.3 32비트 환경입니다.
ncurses 라이브러리는 static link(static build)가 안되나요 ? // gcc -static hello.c -o hello -lncurses 빌드가 안되네요...
gcc hello.c -o hello -lncurses
위와 같이 -static 옵션이 없을때는 빌드와 실행이 잘 됩니다.
gcc -static hello.c -o hello -lncurses
위와 같이 -static 옵션이 있을때는 아래와 같은 에러가 발생합니다.
/tmp/ccq871Lz.o: In function `main': hello.c:(.text+0x1b): undefined reference to `stdscr' hello.c:(.text+0x28): undefined reference to `stdscr' /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libncurses.a(lib_endwin.o): In function `endwin': (.text+0x8): undefined reference to `SP' /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libncurses.a(lib_endwin.o): In function `endwin': (.text+0x2f): undefined reference to `reset_shell_mode' /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libncurses.a(lib_getch.o): In function `_nc_wgetch': (.text+0x1ef): undefined reference to `_nc_keypad' /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../libncurses.a(lib_getch.o): In function `_nc_wgetch': (.text+0x355): undefined reference to `_nc_timed_wait'
ncurses 라이브러리는 정적링크가 안되는 라이브러리인가요 ?
아니면 다른 방법이 있는지요 ?
Forums:
그건 저도 모르겠습니다.
아마도. 라이브러리 때문인거 같은데요.
심볼릭 링크를 연결해주거나. export. path등으로 사용가능하게 해주면 될듯 싶습니다.
그 전에 configure -static과 make LDFLAGS=-static 등이 필요해 보입니다.
해보고 컴파일도 되고. 실행도 되긴하는데.
이게 static인지 아닌지...는 잘 모르겠습니다. 한번 참고해보세요.
----------------------------------------------------------------------------
젊음'은 모든것을 가능하게 만든다.
매일 1억명이 사용하는 프로그램을 함께 만들어보고 싶습니다.
정규 근로 시간을 지키는. 야근 없는 회사와 거래합니다.
각 분야별. 좋은 책'이나 사이트' 블로그' 링크 소개 받습니다. shintx@naver.com
아, ncurses lib'를 재설치하는 방법이 있었네요...
참고자료 감사합니다.
------------------ System programmer...^^
CentOS 6의 ncurses-devel에
CentOS 6의 ncurses-devel에 static library가 없기 때문입니다. -static 옵션을 주면 libncurses.a를 찾게 되는데, so file만 있고 .a가 없어서 빌드가 안되는 겁니다.
Redhat에서 빌드하는 패키지들은 대부분 .a 파일을 빼버리더군요.
답변 감사드립니다.
역시, 라이브러리 문제였네요.
RedHat 계열은 .a 파일류들을 뺀다는걸 몰랐네요...
------------------ System programmer...^^
댓글 달기