Reputation: 21
I'm compiling my c++ project with the flag -std=c++11 because I use override in one of my classes, even so I'm getting this warning:
warning: override controls (override/final) only available with -
std=c++11 or -std=gnu++11 [enabled by default]
I would like to know how to disable this warning or I would appreciate if you can tell me what I am doing wrong.
Upvotes: 0
Views: 2384
Reputation: 528
You can disable warning with pragma
#pragma warning( disable : _WARNING_NUMBER_)
Where _WARNING_NUMBER_ is number of your warning
However, you should always listen to your compiler and fix the warning instead of disabling
Upvotes: 0
Reputation: 238351
I don't think that warning can be separately disabled.
Instead of disabling the warning, I recommend that you fix the bug. Your code uses a language feature that was introduced in C++11, but you compile with an earlier standard enabled. You have two options:
Upvotes: 1