小编dig*_*her的帖子

尝试使用g ++编译目标文件时出现"-std = c ++ 11:command not found"错误

在标题中,当我尝试通过运行此shell脚本使用g ++编译目标文件时:

#!/bin/bash
name=textsweeper
srcdir=src
buildir=build
cc=g++
cppflags=-Wall -std=c++11 -ggdb -O
libs=
rm -f $buildir/$name $buildir/main.o
$cc $cppflags $srcdir/main.cpp -c -o $buildir/main.o
$cc $buildir/main.o $libs -o $buildir/$name
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

$ bash compile
compile: line 6: -std=c++11: command not found
Run Code Online (Sandbox Code Playgroud)

关于事物的其他错误仅在stdc ++ 11中可用.我已经尝试过了解错误,但我只得到关于实际命令不是参数的错误的答案.

c++ linux variables bash gcc

3
推荐指数
1
解决办法
660
查看次数

标签 统计

bash ×1

c++ ×1

gcc ×1

linux ×1

variables ×1