-3

I am using chrono library for calculating elapsed time but I am getting below warning.

warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]

I am beginner in C++ and don't know how to add

QMAKE_CXXFLAGS += -std=c++14

Any help would be highly appreciated.

O'Neil
  • 3,790
  • 4
  • 16
  • 30
sam sivlv
  • 15
  • 1
  • 8

2 Answers2

2

IF you are using a qmake project, it should be

CONFIG += c++14

in the project file as mention in an answer to this post: How can I use C++14 features when building qmake projects

LeBlue
  • 595
  • 7
  • 11
0

You should add the flags in your compiling command:

g++ -std=c++14 chronoprog.cpp -lmpir -o chronoprog

James Maa
  • 1,764
  • 10
  • 20