ADC_MODE(your_chosen_adc_mode) needs to be outside a function - i.e. at the top of your sketch like an include or define statement.
ADC_MODE(ADC_VCC);
void setup() {}
void loop() {
uint32_t getVcc = ESP.getVcc()
}
You will then get a different error if you are using Arduino 1.6.7 or 1.6.8, as it appears that the Arduino builder doesn't correctly forward declarations for functions marked with extern C. Workaround until it is fixed is to downgrade to Arduino 1.6.6 (or 1.6.5 as that appears to be the recommended version atm).
Alternately, until the next version of the ESP8266 core is pushed, you could make the
changes noted in this commit to Esp.h and core_esp8266_phy.c. The line numbers for esp.h were the same for me on Oak 1.0.1, but esp8266_phy.c was out by 10 lines - I inserted the new code at 235 instead of 245 as in the commit. It compiles fine now, but have yet to see if it does anything useful.
EDIT: Yes, it does appear to work, but is reading low (needs calibrating).
Reference update: It appears that this won't be an issue for the next update to the Arduino IDE, as a fix was pushed to the arduino-builder
5 days ago, and should be in the nightly build.
https://github.com/arduino/arduino-builder/pull/128