0

In keilMDK,I try to devolop STM32 with C++.And add --cpp11 to MiscControls.but the warning Show on picture confused me a lot.BTW,I am still learning English.

I try to add --std=C++11 into MiscControls,but it does not work.And get more ERROR show in picture below. enter image description here

enter image description here

enter image description here

Anoop Rana
  • 19,715
  • 4
  • 12
  • 33
  • It's a warning saying that in class initializers are a C++11 feature and you must use `C++11` or higher in order to use them. – Anoop Rana May 23 '22 at 12:09
  • Thanks for comment,I had already add '--cpp11' into MiscControl.But Still warning. – SharkMelon May 23 '22 at 12:21
  • Yes, i saw the images you uploaded and edited your post so that they can be seen directly. – Anoop Rana May 23 '22 at 12:22
  • @SharkMelon Maybe try "-std=c++11", I am not familiar with that toolchain, but it looks gcc-like options. – Quimby May 23 '22 at 12:23
  • I'm fresh man here.And I don't know which step close this question.Annop Rana help me to reopen this .Thanks for you all. – SharkMelon May 23 '22 at 12:29
  • Compiler control string is non-editable. – SharkMelon May 23 '22 at 12:46
  • @SharkMelon I found [c++11 not working with keil](https://community.arm.com/support-forums/f/keil-forum/41706/use-c-in-keil-not-working-right). Looks like same problem. There also the user used `--cpp11` flag in misc control. Also this: [Using the armV5 compiler in keil with c99 and cpp11](https://stackoverflow.com/questions/65934622/using-the-armv5-compiler-in-keil-with-c99-and-cpp11) – Anoop Rana May 23 '22 at 12:48
  • @SharkMelon Try `-std=c++11` instead of `--std=c++11`. Note in you question you have written that you tried `--std=c++11`. Only use a single `-` as you have used 2 `-`. See if it works with a single `-` like `-std=c++11`. – Anoop Rana May 23 '22 at 15:09
  • @SharkMelon Also, refer to [notice cpp11 in misc control as well as compiler control string](https://stackoverflow.com/a/45303356/12002570) and [same problem as yours it seems](https://stackoverflow.com/a/27825106/12002570). – Anoop Rana May 23 '22 at 15:51

0 Answers0