Only available with -std=c++11 or -std=gnu++11 [closed]
Hi everyone, I tried to use "range based for loop" and "lambdas" in my programs. Everything was fine in fact. My IDE didn't throw any error or warning at all. After "catkin_make", I see some warnings in my terminal which says:
/home/serhathp/catkin_ws/src/tcp_edu/src/trial_06.cpp:41:9: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
}
^
and same for "range based for loop" method. How can I handle this issue? What version of compiler do I use in my system? I typed some code in my program related to this issue:
if (__cplusplus == 201703L) std::cout << "C++17\n";
else if (__cplusplus == 201402L) std::cout << "C++14\n";
else if (__cplusplus == 201103L) std::cout << "C++11\n";
else if (__cplusplus == 199711L) std::cout << "C++98\n";
else std::cout << "pre-standard C++\n";
As an output, I gave C++98. Maybe this would be useful information I don't know. Probably related to this issue, I can't use "range based for loop" correctly if I run my program. (I can compile my program actually) It doesn't work like it should! Any relationship? How can I change my compiler version in my system. I want it to be C++11 especially. I'm kind of confused and new at this environment. Any help?
UBUNTU 16.04 - Kinetic - Ros1. I use Visual Studio as IDE.
Thank You!