運行環境:
Ubuntu 16.04.3 x86_64
在Ubuntu下安裝運行Unixbench時,提示報錯信息如下
1
2
3
4
5
6
|
gcc -o ./pgms/ubgears -DTIME -Wall -pedantic -ansi -O2 -fomit-frame-pointer -fforce-addr -ffast-math -Wall ./src/ubgears.c -lGL -lXext -lX11 /usr/bin/ld: /tmp/ccnTgDEZ.o: undefined reference to symbol 'sincos@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Makefile:240: recipe for target 'pgms/ubgears' failed make: *** [pgms/ubgears] Error 1 |
通過查閱資料,由于ubgears.c中會用到數學函數,而實際運行時找不到對應的數學函數,只需要在顯示調用函數函數庫即可,在Makefile中GL_LIBS 后添加-lm
使用ld -v查看ld工具版本
從binutils2.22開始,ld開始把–no-copy-dt-needed-entries默認打開,這樣一來,ld不會再自動遞歸地解析鏈接的lib,而需要由用戶來一一指定。
以上這篇解決Unixbench安裝報錯信息的問題就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持服務器之家。
原文鏈接:http://blog.csdn.net/five0918/article/details/78903242