Fix Unixbench installation error message problem

  • 2020-06-23 02:37:46
  • OfStack

Operating environment:

Ubuntu 16.04.3 x86_64

When installing and running Unixbench under Ubuntu, the error message is as follows


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

By looking up the data, since the mathematical function will be used in ES11en. c, and the corresponding mathematical function cannot be found in the actual run time, it is only necessary to display the function function library and add -lm after GL_LIBS in Makefile

Use ES19en-ES20en to view the ld tool version

Starting from binutils2.22, ld will turn on the linked es26EN-ES27en-ES28en-ES29en-ES30en by default, so that ld will no longer recursively parse the linked lib, but will need to be specified by the user 11.


Related articles: