在使用make编译xpdf时,我得到了以下错误。我试过使用命令:LIBS=-l make,但它不起作用。我知道问题在于c编译器无法识别源代码中的数学代码,因为它无法使用数学库,但我不知道如何修复它。
[ 71%] Linking CXX executable pdftohtml
/usr/bin/ld: CMakeFiles/xpdf_objs.dir/Gfx.cc.o: undefined reference to symbol 'acos@@GLIBC_2.2.5'
//usr/lib64/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [xpdf/CMakeFiles/pdftohtml.dir/build.make:219: xpdf/pdftohtml] Error 1
make[1]: *** [CMakeFiles/Makefile2:428: xpdf/CMakeFiles/pdftohtml.dir/all] Error 2
make: *** [Makefile:130: all] Error 2我已经把我的Makefile和CmakeLists.txt放在烤箱上,以获取更多信息。
发布于 2018-06-13 20:26:27
在调试代码之后,我使用的解决方案是在-lpaper命令期间将DCMAKE_CXX_FLAGS或DCMAKE_EXE_LINKER_FLAGS添加到cmake中,这两种方法都是有效的。谢谢@steeldriver提供了非常好的见解。
https://askubuntu.com/questions/1046009
复制相似问题