首页 > 解决方案 > 如何修复 xtensa-lx106-elf-g++:错误:Arduino IDE 上无法识别的命令行选项“-std=gnu++17”错误

问题描述

这是我第一次使用 Arduino IDE,这是我的代码:我正在尝试在我的 NodeMCU 板(ESP-12E)上使用来自 RCSwitch 的 SendDemo 草图,配置如下,

  1. 选择; 工具->板:->(选择您选择的板)。'通用 ESP8266 模块'
  2. 选择; 工具 -> Flash 模式: -> 'DIO'
  3. 选择; 工具 -> 闪光频率: -> '40MHz'
  4. 选择; 工具 -> CPU 频率: -> '80 MHz'
  5. 选择; 工具 -> 闪存大小: -> '512K (64K SPIFFS)'
  6. 选择; 工具 -> 调试端口: -> '禁用'
  7. 选择; 工具->调试级别:->“无”
  8. 选择; 工具 -> 重置方法: -> 'ck'
  9. 选择; 工具 -> 上传速度: -> '115200'

我一直收到错误,xtensa-lx106-elf-g++: error: unrecognized command line option '-std=gnu++17' exit status 1 Error compiling for board NodeMCU 1.0 (ESP-12E Module). 我该怎么办?

 /*
  Example for different sending methods
  
  https://github.com/sui77/rc-switch/
  
*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {

  Serial.begin(9600);
  
  // Transmitter is connected to Arduino Pin #10  
  mySwitch.enableTransmit(10);
  
  // Optional set protocol (default is 1, will work for most outlets)
  // mySwitch.setProtocol(2);

  // Optional set pulse length.
  // mySwitch.setPulseLength(320);
  
  // Optional set number of transmission repetitions.
  // mySwitch.setRepeatTransmit(15);
  
}

void loop() {

  /* See Example: TypeA_WithDIPSwitches */
  mySwitch.switchOn("11111", "00010");
  delay(1000);
  mySwitch.switchOff("11111", "00010");
  delay(1000);

  /* Same switch as above, but using decimal code */
  mySwitch.send(5393, 24);
  delay(1000);  
  mySwitch.send(5396, 24);
  delay(1000);  

  /* Same switch as above, but using binary code */
  mySwitch.send("010100010001010100110011");
  delay(1000);  
    mySwitch.send("010100010001010100110011");
  delay(1000);

  /* Same switch as above, but tri-state code */ 
  mySwitch.sendTriState("00000FFF0F0F");
  delay(1000);  
  mySwitch.sendTriState("00000FFF0FF0");
  delay(1000);

  delay(20000);
}

标签: arduinonodemcu

解决方案


推荐阅读