![Fedora 19에 라이브러리가 없습니다.](https://linux55.com/image/46333/Fedora%2019%EC%97%90%20%EB%9D%BC%EC%9D%B4%EB%B8%8C%EB%9F%AC%EB%A6%AC%EA%B0%80%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
Fedora 19 64비트에서 컴파일 옵션 -lz 및 -lcrypto를 위해 어떤 패키지를 설치해야 합니까? git을 정적으로 컴파일하려고합니다. 전체 오류 메시지는 다음과 같습니다.
[rubenroy@localhost git]$ make prefix=/home/rubenroy/git-static CFLAGS="${CFLAGS} -static"
LINK git-credential-store
/usr/bin/ld: cannot find -lz
/usr/bin/ld: cannot find -lcrypto
libgit.a(path.o): In function `getpw_str':
path.c:(.text+0xd0b): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libgit.a(wrapper.o): In function `xgetpwuid_self':
wrapper.c:(.text+0xeac): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open':
(.text+0x67fb): warning: the use of `mktemp' is dangerous, better use `mkstemp'
libgit.a(ident.o): In function `add_domainname':
ident.c:(.text+0x3cc): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status
make: *** [git-credential-store] Error 1
[rubenroy@localhost git]$
편집: 이제 라이브러리가 설치되었지만 컴파일할 때 여전히 오류가 발생합니다.
[rubenroy@localhost git]$ make prefix=/home/rubenroy/git-static CFLAGS="${CFLAGS} -static"
LINK git-credential-store
libgit.a(path.o): In function `getpw_str':
path.c:(.text+0xd0b): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
libgit.a(wrapper.o): In function `xgetpwuid_self':
wrapper.c:(.text+0xeac): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libpthread.a(libpthread.o): In function `sem_open':
(.text+0x67fb): warning: the use of `mktemp' is dangerous, better use `mkstemp'
libgit.a(ident.o): In function `add_domainname':
ident.c:(.text+0x3cc): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':
(.text+0x116): undefined reference to `dlopen'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':
(.text+0x12d): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':
(.text+0x142): undefined reference to `dladdr'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':
(.text+0x14e): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(fips.o): In function `FIPSCHECK_verify':
(.text+0x1a6): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x11): undefined reference to `dlopen'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x24): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
(.text+0x2f): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x334): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
(.text+0x3f2): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x464): undefined reference to `dlsym'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
(.text+0x522): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x589): undefined reference to `dlopen'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x5ed): undefined reference to `dlclose'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
(.text+0x625): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
(.text+0x6b1): undefined reference to `dladdr'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
(.text+0x711): undefined reference to `dlerror'
/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
(.text+0x772): undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
make: *** [git-credential-store] Error 1
답변1
해당 정적 라이브러리(예: 파일)가 포함된 libxx.a
패키지를 찾고 있습니다. 일반적으로 공유 라이브러리 + 접미사가 포함된 패키지와 이름이 동일합니다 -static
. 이 경우 zlib-static
및 openssl-static
.
$ repoquery --list zlib-static.x86_64
/usr/lib64/libz.a
/usr/share/doc/zlib-static-1.2.7
/usr/share/doc/zlib-static-1.2.7/README
$ repoquery --list openssl-static.x86_64
/usr/lib64/libcrypto.a
/usr/lib64/libssl.a