vendredi 24 juin 2016

g++ 5.4.0 - unable to use C++14 standard

I installed gcc 5.4.0 recently, on Windows using Cygwin, because I wanted to test the C++14 standard features of g++. When I tried to compile, I get the following error:

$ g++-5.4.0 -std=c++14 test.cpp
-bash: g++-5.4.0: command not found

This is the code I wrote inside test.cpp:

#include <iostream>

int main()
{
    auto lambda = [](auto x){ return x; };
    std::cout << lambda("Hello generic lambda!\n");
    return 0;
}

What could be the problem? I also tried replacing C++14 with C++11 in the command, but got the same error.

Aucun commentaire:

Enregistrer un commentaire