Recently, I'm working on package builds to operate our own software.
However, an error message made me stuck in but I recently resolved it so, leave this working log for me and others.
Issues
For some reasons, we needed to build with -O2 -static options for g++.
As the changes, I got the error messages like:
/user/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
....
Since the only change was the g++ option '-static' , thankfully my colleague suggested me to install glibc-static
Got another issue
So, I installed glib-static-2.17-317* which is latest one I found and installed it.
But, I got dependency error like:
glibc-devel = 2.17.317.... needed by glibc-static-2.17.317....
but I thought my machine has glibc-devel as this output from rpm -q glibc-devel:
$ glibc -q glibc-devel
$ glibc-devel-2.17.157.el7..
At that time, I was not aware of the package version so, just installed what I had like:
$ rpm --nodeps glibc-static-2.17....
It was successfully installed and g++ command for build didn't show the error 'cannot find -lm/ -lc'.
But, the result of build didn't work well.
Resolve the problem
I've tried some resolutions like ... remove files and clone the repository again.. reinstall the rpm package .. but that was not the solution.
While I was trying several dumb works, finally, I found the version of glib-static was not maching to glibc-* rpm packages :
$ rpm -q glibc
glibc-2.17-157 ....
$ rpm -q glibc-devel
glibc-devel-2.17-157...
$ rpm -q glibc-static
glibc-static-2.17-317...
To match the version of glibc things, I removed glib-static-2.17-317 .. and downloaded glib-static-2.17.157* to re-install it.
After re-installation, I don't see any error messages above and the built tools work well.
'Working on' 카테고리의 다른 글
[python] tabulate 에서 float , int , bool type 출력 문제 해결방법 (0) | 2021.11.27 |
---|---|
[Linux] 파일삭제 시 옵션을 신중히 사용하자, rm 명령어 주의사항 (0) | 2021.11.19 |
[shell/csh] csh 에서 환경변수 설정하고 출력하는 방법 (0) | 2021.11.17 |
Hold someone accountable : '~에 책임을 지다' 를 영어로 (0) | 2021.06.20 |
NVIDIA NVTAGS ( Topology-Aware GPU Selection ) 메뉴얼 읽기 - 2 (0) | 2021.06.07 |