草庐IT

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

如标题所示,当我尝试通过运行此shell脚本使用g++编译目标文件时:#!/bin/bashname=textsweepersrcdir=srcbuildir=buildcc=g++cppflags=-Wall-std=c++11-ggdb-Olibs=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我收到以下错误:$bashcompilecompile:line6:-std=c++11:comma

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

如标题所示,当我尝试通过运行此shell脚本使用g++编译目标文件时:#!/bin/bashname=textsweepersrcdir=srcbuildir=buildcc=g++cppflags=-Wall-std=c++11-ggdb-Olibs=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我收到以下错误:$bashcompilecompile:line6:-std=c++11:comma