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

Jason
  • 36,170
  • 5
  • 26
  • 60
  • @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
  • @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) – Jason 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`. – Jason 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). – Jason May 23 '22 at 15:51
  • SharkMelon, your question is closed as duplicate since it has been asked and answered already. Please read the existing answers carefully. The answer of the duplicate questions (which has 34 upvotes), says you have to add `-std=c++11`. In your question you added `--std=c++11`, which is different (and wrong). If you've read and tried all existing answers and they did not solve your issue, please include these steps in your question and explain why your situation is different. Then it might get reopened. Note that questions closed as duplicate are not a problem if they point to the right answer. – wovano Jun 11 '22 at 07:03

0 Answers0