Tu ne peux pas (bon....c'est techniquement possible mais tellement improbable qu'on dira que c'est impossible) avoir la version 2.2 de gcc... On est en à la version 6.x et les versions 4.x ont déjà au moins 5 ans. D'ailleurs, regarde ce que te retourne ta commande : "GNU Which v2.20". Si tu demandais vraiment la version de gcc, tu verrais ceci :
$ gcc --version
gcc (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++ --version
g++ (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
A comparer avec :
which --version
GNU which v2.21, Copyright (C) 1999 - 2015 Carlo Wood.
GNU which comes with ABSOLUTELY NO WARRANTY;
This program is free software; your freedom to use, change
and distribute this program is protected by the GPL.
Tu as peut-être mal compris à quoi sert la commande which. Elle permet de localiser une commande, elle ne donne donc qu'un chemin vers le programma dans le système de fichiers et non des détails sur le programme lui. Voir la page de documentation de la commande : http://pwet.fr/man/linux/commandes/which
Enfin, je le redis et je vais le mettre en gros et en couleur: l'option n'est pas -c++11 mais -std=c++11 !!!
$ g++ -c main.cpp -Wall -Wextra -std=c++11
$ g++ -c main.cpp -Wall -Wextra -c++11
g++: error: unrecognized command line option '-c++11'
Partager