优选主流主机商
任何主机均需规范使用

如何解决Unixbench安装过程中的常见报错问题 - 详细步骤与解决方案

运行环境:

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安装过程中的常见报错问题 - 详细步骤与解决方案