ubuntu g++: error: unrecognized command line option ‘-fno-plt’

今天在编译chineseocr_lite下面的psenet的时候出现了下面的错误:

g++: error: unrecognized command line option ‘-fno-plt’
Makefile:10: recipe for target 'pse.so' failed
make: *** [pse.so] Error 1
make: Leaving directory '/media/data/projects/OCR/chineseocr_lite/psenet/pse'
Traceback (most recent call last):
  File "app.py", line 12, in 
    from model import  text_predict,crnn_handle
  File "/media/data/projects/OCR/chineseocr_lite/model.py", line 3, in 
    from  psenet import  PSENet,PSENetHandel
  File "/media/data/projects/OCR/chineseocr_lite/psenet/__init__.py", line 2, in 
    from .PSENET import PSENetHandel
  File "/media/data/projects/OCR/chineseocr_lite/psenet/PSENET.py", line 8, in 
    from .pse import decode as pse_decode
  File "/media/data/projects/OCR/chineseocr_lite/psenet/pse/__init__.py", line 10, in 
    raise RuntimeError('Cannot compile pse: {}'.format(BASE_DIR))
RuntimeError: Cannot compile pse: /media/data/projects/OCR/chineseocr_lite/psenet/pse

解决方法

sudo apt install gcc-6
sudo apt install g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6

参考文献

[1].How can I update gcc 5.3 to 6.1? [duplicate]. https://askubuntu.com/questions/781972/how-can-i-update-gcc-5-3-to-6-1

[2].g++: error: unrecognized comma line option ‘-fno-plt’. https://github.com/argman/EAST/issues/233

你可能感兴趣的:(ubuntu)