jeudi 2 avril 2020

Not same behavior of Make in Windows as on Linux, how to compile simple C++11 code with Make on Windows?

I have started to study C++ and previously compiled with make in Linux. Now I'm trying to use VS Code in Windows with the Codeblocks GCC package installed and added the appropriate path to the PATH variable. I am using a C++11 feature Foreach and I need to specify this in the compiler call. I want to run make code and have it compiled adequately with the standard used. I have this functionality in Linux but here in Windows is behaving differently.

#include <iostream>
int main(void)  {
    using namespace std;
    for (short i : {1, 2, 3, 4, 5, 6, 7, 8, 9})
    {
        cout << i << endl;
    }

}

Aucun commentaire:

Enregistrer un commentaire