Not able to use functions from user_interface.h
Posted: Sat Jul 02, 2016 2:45 pm
Hi,
I am using eclipse Arduino ide for development of esp projects. Everything works fine but when I add any method from user_interface.h, for example wifi_station_set_hostname(char *), it gives me a strange error stating "undefined reference" of wifi_station_set_hostname method. Somewhere in this forum I found that the following construct would resolve the problem:
This thing works well in Arduino ide, but with eclipse arduino ide setup I still get the same error.
Strangely when I add a method in one of my custom classes and there if I put wifi_station_set_hostname inside that function along with the extern-include setup, it works.
Could anyone put some light here.
The specific error starts at combiner:
I am using eclipse Arduino ide for development of esp projects. Everything works fine but when I add any method from user_interface.h, for example wifi_station_set_hostname(char *), it gives me a strange error stating "undefined reference" of wifi_station_set_hostname method. Somewhere in this forum I found that the following construct would resolve the problem:
Code: Select all
extern "C"{
#include "user_interface.h"
}
This thing works well in Arduino ide, but with eclipse arduino ide setup I still get the same error.
Strangely when I add a method in one of my custom classes and there if I put wifi_station_set_hostname inside that function along with the extern-include setup, it works.
Could anyone put some light here.
The specific error starts at combiner:
Code: Select all
'Finished building: C:/Users/DK/Arduino/libraries/RadioControllerESP/RadioControllerESP.cpp'
' '
'Starting combiner'
"G:\debojit\electronics project\2016\ide\eclipseArduino\arduinoPlugin\tools\esp8266\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc" -g -Os -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-LG:/debojit/electronics project/2016/ide/eclipseArduino/arduinoPlugin/packages/esp8266/hardware/esp8266/2.2.0/tools/sdk/lib" "-LG:/debojit/electronics project/2016/ide/eclipseArduino/arduinoPlugin/packages/esp8266/hardware/esp8266/2.2.0/tools/sdk/ld" "-Teagle.flash.4m1m.ld" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy -o "G:/debojit/electronics project/2016/ide/eclipseArduino/workspace/ESPServer/Release/ESPServer.elf" -Wl,--start-group ./.ino.cpp.o ./libraries/SPI/SPI.cpp.o ./libraries/RadioControllerESP/GenericList.cpp.o ./libraries/RadioControllerESP/RadioControllerESP.cpp.o ./libraries/RF24Network/RF24Network.cpp.o ./libraries/RF24Network/Sync.cpp.o ./libraries/RF24Mesh/RF24Mesh.cpp.o ./libraries/RF24/RF24.cpp.o ./libraries/ESP8266mDNS/ESP8266mDNS.cpp.o ./libraries/ESP8266WiFi/src/ESP8266WiFi.cpp.o ./libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp.o ./libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp.o ./libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp.o ./libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp.o ./libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp.o ./libraries/ESP8266WiFi/src/WiFiClient.cpp.o ./libraries/ESP8266WiFi/src/WiFiClientSecure.cpp.o ./libraries/ESP8266WiFi/src/WiFiServer.cpp.o ./libraries/ESP8266WiFi/src/WiFiUdp.cpp.o ./libraries/ESP8266WebServer/src/ESP8266WebServer.cpp.o ./libraries/ESP8266WebServer/src/Parsing.cpp.o arduino.ar "G:/debojit/electronics project/2016/ide/eclipseArduino/workspace/ESPServer/Release/arduino.ar" -lm -lgcc -lhal -lphy -lpp -lnet80211 -lwpa -lcrypto -lmain -lwps -laxtls -lsmartconfig -lmesh -lwpa2 -llwip -Wl,--end-group "-LG:/debojit/electronics project/2016/ide/eclipseArduino/workspace/ESPServer/Release"
./.ino.cpp.o: In function `requestHandler()':
G:\debojit\electronics project\2016\ide\eclipseArduino\workspace\ESPServer\Release/../WiFiAccessPoint.ino:126: undefined reference to `wifi_station_set_hostname(char*)'
./.ino.cpp.o: In function `String::operator!=(char const*) const':
G:\debojit\electronics project\2016\ide\eclipseArduino\arduinoPlugin\packages\esp8266\hardware\esp8266\2.2.0\cores\esp8266/WString.h:190: undefined reference to `wifi_station_set_hostname(char*)'
collect2.exe: error: ld returned 1 exit status
makefile:93: recipe for target 'ESPServer.elf' failed
make: *** [ESPServer.elf] Error 1