Tente instalar:
- libstdc ++ - estático
- glibc-static
A partir do Redhat 7 / CentOS 7, as bibliotecas estáticas foram movidas para um pacote opcional. No CentOS 6, fazia parte de:
- libstdc ++ - devel
- glibc-devel
Eu tenho uma biblioteca secreta construída para o CentOS 6.5 como um pacote. Eu não posso construir o pacote para o CentOS 7.4, fazer a instalação falhar nesta linha:
$ gcc -static -O3 -Wno-long-long -funroll-loops -Wall -g -DLINUX testlib.c -o test-lib -L. -llsh -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lc
Eu tentei investigar isso, por exemplo:
$ ld -lstdc++ --verbose
...
attempt to open /usr/x86_64-redhat-linux/lib64/libstdc++.so failed
attempt to open /usr/x86_64-redhat-linux/lib64/libstdc++.a failed
attempt to open /usr/lib64/libstdc++.so failed
attempt to open /usr/lib64/libstdc++.a failed
attempt to open /usr/local/lib64/libstdc++.so failed
attempt to open /usr/local/lib64/libstdc++.a failed
attempt to open /lib64/libstdc++.so failed
attempt to open /lib64/libstdc++.a failed
attempt to open /usr/x86_64-redhat-linux/lib/libstdc++.so failed
attempt to open /usr/x86_64-redhat-linux/lib/libstdc++.a failed
attempt to open /usr/local/lib/libstdc++.so failed
attempt to open /usr/local/lib/libstdc++.a failed
attempt to open /lib/libstdc++.so failed
attempt to open /lib/libstdc++.a failed
attempt to open /usr/lib/libstdc++.so failed
attempt to open /usr/lib/libstdc++.a failed
ld: cannot find -lstdc++
Eu dou uma olhada em alguns caminhos e achei isto: /usr/lib/libstdc++.so.6 Eu criei o symlink (tentei enganar isso), mas ocorreu outro erro:
$ sudo ln -s /usr/lib/libstdc++.so.6.0.19 /usr/lib/libstdc++.so
$ ld -lstdc++ --verbose
...
attempt to open /usr/x86_64-redhat-linux/lib64/libstdc++.so failed
attempt to open /usr/x86_64-redhat-linux/lib64/libstdc++.a failed
attempt to open /usr/lib64/libstdc++.so failed
attempt to open /usr/lib64/libstdc++.a failed
attempt to open /usr/local/lib64/libstdc++.so failed
attempt to open /usr/local/lib64/libstdc++.a failed
attempt to open /lib64/libstdc++.so failed
attempt to open /lib64/libstdc++.a failed
attempt to open /usr/x86_64-redhat-linux/lib/libstdc++.so failed
attempt to open /usr/x86_64-redhat-linux/lib/libstdc++.a failed
attempt to open /usr/local/lib/libstdc++.so failed
attempt to open /usr/local/lib/libstdc++.a failed
attempt to open /lib/libstdc++.so succeeded
ld: skipping incompatible /lib/libstdc++.so when searching for -lstdc++
attempt to open /lib/libstdc++.a failed
attempt to open /usr/lib/libstdc++.so succeeded
ld: skipping incompatible /usr/lib/libstdc++.so when searching for -lstdc++
attempt to open /usr/lib/libstdc++.a failed
ld: cannot find -lstdc++
CentOS 6.5:
$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
CentOS 7.4:
$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
Por favor, ajude a consertar isso. Além disso, estou ansioso para obter alguns conselhos sobre como investigar esses problemas.
Você provavelmente precisará da versão devel
das bibliotecas, então instale:
libstdc++-devel-4.8.5-16.el7
glibc-devel-2.17-196.el7