Using the new Arduino IDE for ESP8266 and found bugs, report them here

Moderator: igrr

User avatar
By somedude
#43408 Hello everybody,


Thank you for the opportunity and I must say, I love the ESP after just two days of playing around with them!!!

Since I am familiar with the Arduino IDE environment, I decided to continue on the same path and installed the ESP library.
My IDE is 1.6.8, but the issue I will describe below also happened in 1.6.5 (that is why I upgraded).
The core is the contributed ESP8266 version 2.1.0.

Sorry for posting this in the bugs section, but I have no reason to believe otherwise, since my code only contains one line. Unless, of course, it's my environment, but... here it is, anyway:

Code: Select all#include <ESP8266WiFi.h>
ADC_MODE(ADC_VCC);

void setup() {
}
void loop() {
}


The error is:
Code: Select allexit status 1
previous declaration of 'int __get_adc_mode()' with 'C++' linkage

or more detailed (and cleaned up a bit):
Code: Select allC:\Users\zzzz\AppData\Local\Temp\arduino_modified_sketch_659241\ESP_sensors_wifi.ino: In function 'int __get_adc_mode()':
ESP_sensors_wifi:3: error: previous declaration of 'int __get_adc_mode()' with 'C++' linkage
 ADC_MODE(ADC_VCC);
     ^
In file included from C:\Users\zzzz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/Arduino.h:247:0,
                 from C:\Users\zzzz\AppData\Local\Temp\build3e8b00d6616d95394bd09565efec4913.tmp\sketch\ESP_sensors_wifi.ino.cpp:1:
C:\Users\zzzz\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/Esp.h:74:58: error: conflicts with new declaration with 'C' linkage
 #define ADC_MODE(mode) extern "C" int __get_adc_mode(void) { return (int) (mode); }
                                                          ^
C:\Users\zzzz\AppData\Local\Temp\arduino_modified_sketch_659241\ESP_sensors_wifi.ino:3:1: note: in expansion of macro 'ADC_MODE'
 ADC_MODE(ADC_VCC);
 ^


Is there an easy/quick way to fix this? Maybe with an #ifdef?
I would be more than happy to try, but I would need details on which file to change as I am but an amateur programmer.

Thank you and best regards.
User avatar
By somedude
#43429 Oups....

Thank you very much Martin for the prompt reply.
I feel quite stupid for posting this under the bugs category, especially since it was my first post.
That was very smug on my part to assume that what I was doing was correct and the experts that wrote the core missed it.
The simplicity of it led me to believe that there was an issue. There was, but with the code I found on the web and I thought would work directly in the IDE...

Thank you very much for straightening me out and I will be more humble in the future.