Another compiling error

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Another compiling error

#1 Post by BertB » 25 May 2016, 16:34

While compiling R107, this is what I get:

Arduino: 1.6.8 (Windows Vista), Board:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Serial, 115200, 4M (3M SPIFFS)"

C:\Users\Bert\AppData\Local\Temp\arduino_modified_sketch_327360\ESPEasy.ino: In function 'int __get_adc_mode()':

ESPEasy:224: error: previous declaration of 'int __get_adc_mode()' with 'C++' linkage

ADC_MODE(ADC_VCC);

^

In file included from C:\Tools\Arduino 1.6.8\arduino-1.6.8\portable\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/Arduino.h:247:0,

from sketch\ESPEasy.ino.cpp:1:

C:\Tools\Arduino 1.6.8\arduino-1.6.8\portable\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\Bert\AppData\Local\Temp\arduino_modified_sketch_327360\__Plugin.ino:224:1: note: in expansion of macro 'ADC_MODE'

#endif

^

exit status 1
previous declaration of 'int __get_adc_mode()' with 'C++' linkage

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

nightshark
Normal user
Posts: 25
Joined: 29 Apr 2016, 06:54

Re: Another compiling error

#2 Post by nightshark » 25 May 2016, 20:50

Use version 1.6.5 of the IDE.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Another compiling error

#3 Post by BertB » 25 May 2016, 21:24

That is New to me. I Always use 1.6.8.
But it seems to work.

NietGiftig
Normal user
Posts: 103
Joined: 16 Sep 2015, 20:32

Re: Another compiling error

#4 Post by NietGiftig » 27 May 2016, 15:24

It's a bug in 1.6.8
In the nightly builds it is resolved.
This seems to be caused by arduino-builder not generating correct forward declarations for functions marked with extern C.
I'll see if we can implement a workaround for this, since the just-released arduino 1.6.8 is affected by this issue.
https://github.com/esp8266/Arduino/issues/1759

Or you can set the #define FEATURE_ADC_VCC to false
Then it builds correct with 1.6.8

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Another compiling error

#5 Post by BertB » 27 May 2016, 18:05

Thanks.

stefbo
Normal user
Posts: 19
Joined: 24 Apr 2016, 15:35
Location: Germany

Re: Another compiling error

#6 Post by stefbo » 28 May 2016, 01:15

The workaround from https://github.com/esp8266/Arduino/issues/1759 (by tamptus 26.Apr) works for me with 1.6.8 when I replace the call to ADC_MODE(ADC_VCC) with #include "adc.h" (see qutation below)
Add a new Tab with file adc.h
with one line:
ADC_MODE(ADC_VCC)

add
#include "adc.h"
as first include in first tab.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 99 guests