c++ - Building C++11 with TextMate? -
with regular c++98 program, run textmate, need ⌘r run textmate. c++11, not work out of box. instance if have following program:
#include <iostream> using namespace std; int main() { (auto : {1, 2, 3}) cout << << " "; cout << "\n"; }
then doing ⌘r results in following c++11 build errors:
untitled:6:10: warning: 'auto' type specifier c++11 extension [-wc++11-extensions] (auto : {1, 2, 3}) ^ untitled:6:17: warning: range-based loop c++11 extension [-wc++11-extensions] (auto : {1, 2, 3}) ^ untitled:6:19: error: cannot deduce type of initializer list because std::initializer_list not found; include <initializer_list> (auto : {1, 2, 3}) ^ 2 warnings , 1 error generated.
this program runs fine in xcode or simple make (i have export cxxflags="-std=c++0x”
in .bashrc takes care of make). can build command-line clang++ -std=c++11 test.cpp
, not compiler issue, textmate configuration.
looking @ textmate run bundle, can see references tm_cxx_flags
. textmate preferences, appended -std=c++0x
, -wc++11-extensions
tm_cxx_flags
. did not seem help.
clearly i’m overlooking obvious here.
any pointers on how fix this?
the default variables in preferences → variables disabled default.
so need enable tm_cxx_flags
checking check box in left-most column.
Comments
Post a Comment