- Tue May 24, 2016 8:29 pm
#47979
Sorry about dribbling this out. I have looked into the issue of
"The second issue with strdup() reveal that there something wrong with your environment, because it is part of following file of the core : .arduino15/packages/esp8266/hardware/esp8266/2.2.0/cores/esp8266/libc_replacements.c"
EclipseArduino duplicates esp8266/2.2.0 and its version of libc_replacements.c is identical to that of the Arduino IDE.
I focused on strdup() because at least I know a lot moe c than c++ and the issues are probably related. I discovered that the prototype is
#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 500)
char *_EXFUN(strdup,(const char *));
#endif
If I put
extern char *strdup(const char *);
In my program, the error goes away.
It seems that eclipse defines __STRICT_ANSI__ but I can't modify that definition. The compiler log shows
"C:\eclipseArduino\arduinoPlugin\tools\esp8266\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ " etc.
ie. "C:\eclipseArduino\arduinoPlugin\tools\esp8266\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:/eclipseArduino/arduinoPlugin/packages/esp8266/hardware/esp8266/2.2.0/tools/sdk/include" "-IC:/eclipseArduino/arduinoPlugin/packages/esp8266/hardware/esp8266/2.2.0/tools/sdk/lwip/include" -c -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DARDUINO=10606 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DESP8266 -I"C:\eclipseArduino\arduinoPlugin\packages\esp8266\hardware\esp8266\2.2.0\cores\esp8266" -I"C:\eclipseArduino\arduinoPlugin\packages\esp8266\hardware\esp8266\2.2.0\variants\d1_mini" -MMD -MP -MF".ino.cpp.d" -MT".ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "../.ino.cpp" -o ".ino.cpp.o" -Wall
suggesting the compiler is "undefining" __STRICT_ANSI__ I can't find a place where _XOPEN_SOURCE is defined or how I could define it.
I have not yet determined if this is related to the WiFi.RSSI(i), etc., problems
Thanks again for the help