fatal error: bytecode stream generated with LTO version x.0 instead of the expected x.x

版权声明:欢迎交流学习,转载请注明出处。 https://blog.csdn.net/qq_23869697/article/details/89606575

问题描述:

Ubuntu16.04安装uwsgi时出现的错误。
err_uwsgi

原因

官方文档上说
To build uWSGI you need Python and a C compiler (gcc and clang are supported).
系统已经安装了Python 3.6, 可能gcc的版本不对, 但是上面错误说是LTO的版本不对。
查了一哈,【这里
This error basically means that you’ve got some binary build results (mostly object files) which are incompatible with other binary build results, but you’re trying to link them together.
ubuntu16.04的版本太高了。

解决方法

把GCC的版本改成需要的版本,安装4.8试试。
Ubuntu16.04多个版本GCC编译器的安装和切换

  1. 查看GCC,G++的版本的版本
    gcc -v
    g++ -v
    gcc
  2. 安装
    sudo apt-get install gcc-4.8
    jinstall_gcc
    3.查看当前版本
    ls /usr/bin/gcc*
    4.设置4.8为优先使用版本
    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100
    5.重新安装uwsgi
    pip install uwsgi
    install_uwsgi

猜你喜欢

转载自blog.csdn.net/qq_23869697/article/details/89606575