语言

Menu
Sites
Language
How can I use C++11 in native app?

Hi,

I tried lambda function in native application.

but, It raise build error. "expected expression".

I'm changed Toolchain Informations from "LLVM-3.4" to "GCC-4.8".

but It raise warning. "lambda expressions only available with -std=c++11 or -std=gun+11 [enabled by defualt]".

How can I use C++11 in native application without build warning?

 

响应

4 回复
Kiwook Hong

Hello.

Add an option.

Right click of Project > Properties > C/C++ Build > Settings > Tool Settings > C ++ Compiler (C Compiler) > Miscellaneous

Add “–std=c++0x” flag.

I hope you succeed.

연호 조

Thank you for your assistance.

Builder is work very well!

Bogon Kim

https://gcc.gnu.org/projects/cxx0x.html

gcc 4.3 to 4.6 , use “–std=c++0x”

gcc 4.7 or later use -std=c++11 and -std=gnu++11

for llvm use -std=c++11 only.

 

so generally, you need to use -std=c++11

연호 조

Thank you for your assistance.

It is good solution.