error: unrecognized command line option "-std=c11" 解决办法

今天在安装php版本 grpc扩展的时候报错如下:

cc1: error: unrecognized command line option "-std=c11"

cc1: warnings being treated as errors

cc1: error: unrecognized command line option "-Wno-parentheses-equality"

开始搜寻解决方案,经查,出现这个 编译错误的原因在g++ gcc 版本不够高。

解决办法:默认gcc版本一般情况是4.4.7,更新gcc版本,本方案升级到4.8.2

查看gcc版本

gcc -v

显示版本

gcc 版本 4.4.7

1.下载压缩包进行编译安装

http://ftp.gnu.org/gnu/gcc/
    这里是官网提供的下载地址

2.下载解压

wget http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/
tar -jxvf gcc-4.8.2.tar.bz2

3.下载供编译需求的依赖项

这个神奇的脚本文件会帮我们下载、配置、安装依赖库,可以节约我们大量的时间和精力。

cd gcc-4.8.2
./contrib/download_prerequisites

4.建立一个文件夹

mkdir gcc-build-4.8.2
cd gcc-build-4.8.2

5.生成Makefile文件

../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib

6.编译安装

make && make intsall

然后等待就可以了,这个过程一般需要3个小时。

等安装 完了,再查看

原文地址:https://www.cnblogs.com/kumufengchun/p/10192324.html

时间: 2024-08-25 04:33:19

error: unrecognized command line option "-std=c11" 解决办法的相关文章

在WSL中安装swool报错 error: unrecognized command line option '-V' 的解决方法

Windows Subsystem for Linux Ubuntu中使用pecl安装swool时遇到错误"error: C compiler cannot create executables"."error: unrecognized command line option '-V'" 解决方法 先看解决方法, 将gcc版本降低到4.8即可,因为高版本gcc取消了-V参数: sudo apt install gcc-4.8 -y sudo update-alte

linux 升级g++ [错误:unrecognized command line option “-std=c++11”]

出现这个编译错误的原因在g++ gcc 版本不够高. 添加源(Ubuntu) 1 2 $ sudo add-apt-repository ppa:ubuntu-toolchain-r/test $ sudo apt-get update 安装4.8版本 ? 1 $ sudo apt-get install gcc-4.8 g++-4.8 查看本地安装版本 1 2 3 $ ls -lh /usr/bin/g++* 这里应该可以看到本机安装了4.6和4.8两个版本. 切换版本 1 2 3 4 5 s

linux下配置QT5.12 ERROR: Unknown command line option '-no-xcursor'.!

xcursor是个什么东西.为什么会报错,怎么处理!在qt的autoconfigure.sh中添加下三条命令都不行.提示不认识-no-xcursor或者不认识nomake命令. -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-separate-debug-info -no-fontconfig \-nomake examples -nomake tools -nomake tests -no-iconv \ linux下配置QT5.12 ERR

Command line option syntax error.type Command /? for help

电脑装思维导图的时候,报错显示"Command line option syntax error.Type Command /? for help."就查了一下,原来是系统没有C++2005,需要安装,就上网下载了一个vcredist_x86.exe,但是双击安装,仍然出现这个错误. 没办法,接着上网查吧,是什么原因呢?网上说是因为该文件安装不支持中文安装路径,然后我就把文件夹改成了英文名称的,但是双击还是出现这个错误.可能有的人用这种方法成功了吧~本着没有解决不了的问题的思想,接着奋

安装SQL Servre2000时提示“command line option syntax error! type command /? for help”

问题: 当程序正在安装ms数据访问组件时,弹出错误提示框:command line option syntax error,type command/? for help,点击确定继续:到了程序正在安装HTML帮助时,弹出标题为html help 1.32 update错误提示框:command line option syntax error,type command/? for help,点击确定继续:程序开始复制文件,复制完后弹出错误提示框:无法找到动态连接库sqlunirl.dll(sq

“command line option syntax error,Type command/?for help

VS2010安装WDT时出现"command line option syntax error,Type command/?for help错误 解决:可能是因为你的安装源文件所在的路径中有中文,所以你可将安装文件放在一个没有中文的路径. "command line option syntax error,Type command/?for help,布布扣,bubuko.com

安装vcredist_x86,报错提示:Command line option syntax error.Type Command /?for Help

在安装loadrunner11的时候,提示缺少vc2005_sp1_with_atl_fix_redist组件,可以直接点击确定进行安装组件,或者进入loadrunner目录下lrunner\Chs\prerequisites\vc2005_sp1_redist手动安装vcredist_x86.exe,这时候出现了报错:Command line option syntax error.Type Command /?for Help 解决方案: 修改环境变量 修改完之后就可以正常安装啦 参考地址:

真机测试报错ERROR/AndroidRuntime: java.lang.RuntimeException: setParameters failed解决办法

这个错误是和调用相机摄像头相关的. 产生这个错误的原因主要在于代码控制分辨率的显示和真机测试分辨率不一样. 一:解决办法 WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); Camera.Parameters parameters = camera.getParameters();// 得到摄像头的参数 para

[ArchLinux]进行更新时出现错误:GPGME error: 无数据,数据库无效的解决办法/

今天在我进行系统更新pacman -Syu时,出现了如下错误: # pacman -Syu 错误:GPGME error: 无数据 错误:GPGME error: 无数据 错误:GPGME error: 无数据 错误:GPGME error: 无数据 错误:GPGME error: 无数据 :: 正在同步软件包数据库... core 已经是最新版本 0.0 B 0.00B/s 00:00 [----------------------] 0% extra 已经是最新版本 0.0 B 0.00B/