0

For android purpose I am forced to use qmake instead of cmake. I can set C++ standard to C++11 using

CONFIG += c++11

but I also have some C files which uses C11 . when I compile them I get errors like

error: blahblah only allowed in C99 or C11 mode

So I tried

CONFIG += c11 

which is also not working . what can I do set it to gnu11 or c11

2 Answers2

1

I am able to solve it this way

QMAKE_CFLAGS += -std=gnu11

0

If I understand you correctly, you try to force qmake to c++11, but you still have the same errors as it is not c++11. Try

#incude <iostream>

int main()
{
  std::cout << __cplusplus;
}

Compiler that supports С++98/03 builds a program that prints 199711 For С++11 the output is 201103 For С++14 it is 201300 or 201402
You have to rebuid your project after editing .pro file

Rabter
  • 952
  • 1
  • 6
  • 9