-std = c ++ 11 não funciona com o Sublime Text 2 no Mac

0

Então, eu instalei o gcc 4.7 com portas. Compilando manualmente meu arquivo com %código% Ele identifica um erro. Ao anexar o g++ file.cpp -o file , funciona como um encanto. Agora eu editei meu C ++. Sublime-build:

{
    "cmd": ["g++", "-std=c++11", "${file}", "-o", "${file_path}/${file_base_name}"],
    "working_dir": "${file_path}",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "selector": "source.c, source.c++",

    "variants":
    [
        {
            "name": "Run",
            "cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
        }
    ]
}

Isso gera esses erros estranhos:

/Users/magnus/Coding/Stuff/vector.cpp:6:14: error: no matching constructor for initialization of 'vector<int>'
        vector<int> numbers{1, 2, 3};
                    ^      ~~~~~~~~~
/usr/include/c++/4.2.1/bits/stl_vector.h:255:9: note: candidate constructor [with _InputIterator = int] not viable: no known conversion from 'int' to 'const allocator_type' (aka 'const std::allocator<int>') for 3rd argument
        vector(_InputIterator __first, _InputIterator __last,
        ^
/usr/include/c++/4.2.1/bits/stl_vector.h:213:7: note: candidate constructor not viable: no known conversion from 'int' to 'const allocator_type' (aka 'const std::allocator<int>') for 3rd argument
      vector(size_type __n, const value_type& __value = value_type(),
      ^
/usr/include/c++/4.2.1/bits/stl_vector.h:201:7: note: candidate constructor not viable: allows at most single argument '__a', but 3 arguments were provided
      vector(const allocator_type& __a = allocator_type())
      ^
/usr/include/c++/4.2.1/bits/stl_vector.h:231:7: note: candidate constructor not viable: requires single argument '__x', but 3 arguments were provided
      vector(const vector& __x)
      ^
1 error generated.
[Finished in 0.2s with exit code 1]

Por que funciona no terminal, mas se recusa a trabalhar na ST2?

    
por Magnus 16.10.2013 / 14:51

0 respostas