Build error when building a project with Azure IoT Arduino libraries
Closed this issue · 5 comments
I have built a relatively simple Arduino project successfully with makeEspArduino, which is great. Now I'm trying to build a more complex project that involves Microsoft's Azure IoT libraries, and the build fails with a compiler error for the very first file.
I tried to track this down, and the reason appears to be that in the failing build additional include directories from the ESP8266 gcc installation are provided on the compiler command line that cause a compilation failure.
This is the very first file that is compiled in the failing build (sorry for the very long lines):
"/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/include" "-I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/lwip2/include" "-I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/mkESP/simplesample_http_generic/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DARDUINO=10605 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD=\"ESP8266_GENERIC\" -DESP8266 -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//cores/esp8266 -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//variants/generic -I/tmp/mkESP/simplesample_http_generic -I../azure-iot-arduino-protocol-http/src/ -I../azure-iot-arduino-utility/src/ -I../azure-iot-arduino-utility/src/adapters/ -I../azure-iot-arduino-utility/src/azure_c_shared_utility/ -I../azure-iot-arduino-utility/src/esp8266/ -I../azure-iot-arduino-utility/src/samd/ -I../azure-iot-arduino/src/ -I../azure-iot-arduino/src/azure_umqtt_c/ -I../azure-iot-arduino/src/sdk/ -I./ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/bootloaders/eboot/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/cores/esp8266/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/cores/esp8266/libb64/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/cores/esp8266/spiffs/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/cores/esp8266/umm_malloc/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ArduinoOTA/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/DNSServer/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/EEPROM/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266AVRISP/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266HTTPClient/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266HTTPUpdateServer/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266LLMNR/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266NetBIOS/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266SSDP/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266WebServer/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266WebServer/src/detail/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266WiFi/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266WiFi/src/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266WiFiMesh/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266httpUpdate/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/ESP8266mDNS/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/Ethernet/examples/udpntpclient_pedantic/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/Ethernet/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/Ethernet/src/utility/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/GDBStub/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/GDBStub/src/internal/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/GDBStub/src/xtensa/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/GDBStub/src/xtensa/config/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/Hash/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/Hash/src/sha1/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/SD/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/SD/src/utility/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/SPI/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/SPISlave/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/Servo/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/Servo/src/esp8266/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/TFT_Touch_Shield_V2/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/Ticker/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/Wire/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries/esp8266/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tests/device/libraries/BSTest/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tests/host/common/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/include/json/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/libc/xtensa-lx106-elf/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/libc/xtensa-lx106-elf/include/machine/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/libc/xtensa-lx106-elf/include/sys/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/libc/xtensa-lx106-elf/include/xtensa/config/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip/include/arch/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip/include/lwip/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip/include/lwip/app/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip/include/netif/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/arch/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/lwip/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/lwip/apps/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/lwip/priv/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/lwip/prot/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/netif/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/netif/ppp/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/netif/ppp/polarssl/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/posix/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/sdk/lwip2/include/posix/sys/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/include/gdb/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/include-fixed/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/install-tools/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/install-tools/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/plugin/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/plugin/include/c-family/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/plugin/include/config/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/plugin/include/config/xtensa/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/plugin/include/cp/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/backward/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/debug/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/decimal/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/ext/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/parallel/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/profile/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/profile/impl/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/tr1/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/xtensa-lx106-elf/bits/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/xtensa-lx106-elf/ext/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/machine/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/sys/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/xtensa/config/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/ESPDuino/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/adafruit/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/arduino_spi/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/arduino_uart/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/d1/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/d1_mini/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/espino/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/espinotee/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/espresso_lite_v1/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/espresso_lite_v2/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/generic/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/nodemcu/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/oak/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/phoenix_v1/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/phoenix_v2/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/thing/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/wifinfo/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/variants/wifio/ /mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//cores/esp8266/abi.cpp -o /tmp/mkESP/simplesample_http_generic/abi.cpp.o
In file included from /mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include/stdlib.h:11:0,
from /mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//cores/esp8266/abi.cpp:19:
/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include/stdio.h:158:18: error: '__gnuc_va_list' has not been declared
#define __VALIST __gnuc_va_list
^
/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include/_ansi.h:65:35: note: in definition of macro '_EXFUN'
#define _EXFUN(name, proto) name proto
^
/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include/stdio.h:184:65: note: in expansion of macro '__VALIST'
int _EXFUN(vfprintf, (FILE *__restrict, const char *__restrict, __VALIST)
<more errors follow>
This is the compiler invocation for the first file abi.cpp
for the succeeding build from the simple build:
"/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/include" "-I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/lwip2/include" "-I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include" "-I/tmp/mkESP/radmon_generic/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DARDUINO=10605 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD=\"ESP8266_GENERIC\" -DESP8266 -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//cores/esp8266 -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//variants/generic -I/tmp/mkESP/radmon_generic -I./ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ArduinoOTA/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/DNSServer/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/EEPROM/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266AVRISP/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266HTTPClient/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266HTTPUpdateServer/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266LLMNR/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266NetBIOS/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266SSDP/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266WebServer/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266WebServer/src/detail/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266WiFi/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266WiFi/src/include/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266WiFiMesh/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266httpUpdate/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/ESP8266mDNS/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/Ethernet/examples/udpntpclient_pedantic/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/Ethernet/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/Ethernet/src/utility/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/GDBStub/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/GDBStub/src/internal/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/GDBStub/src/xtensa/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/GDBStub/src/xtensa/config/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/Hash/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/Hash/src/sha1/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/SD/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/SD/src/utility/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/SPI/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/SPISlave/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/Servo/src/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/Servo/src/esp8266/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/TFT_Touch_Shield_V2/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/Ticker/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/Wire/ -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//libraries/esp8266/src/ /mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//cores/esp8266/abi.cpp -o /tmp/mkESP/radmon_generic/abi.cpp.o
Note all the include directories in the compiler command line of the failing build which start with -I/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf
which are not there in the succeeding build.
I compared the preprocessor output for abi.cpp for the two builds with the gcc -dD
flag. Here are the first lines that differ:
Failing build:
# 37 "/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include/stdio.h" 2
#define __need___va_list
# 1 "/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/tr1/stdarg.h" 1
# 30 "/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/tr1/stdarg.h"
#define _TR1_STDARG_H 1
Succeeding build:
# 37 "/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include/stdio.h" 2
#define __need___va_list
# 1 "/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/include/stdarg.h" 1 3 4
# 34 "/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/tools/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/include/stdarg.h" 3 4
#undef __need___va_list
So it looks to me like the stdarg.h
header form the .../tools/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/tr1
directory is spoiling the compilation.
So the question is, why are all the -I
include directives for the .../tools/xtensa-lx106-elf/...
directories present, and should they be actually present?
The problem is probably the automatic search for includes which is initiated when no explicit definition of the LIBS variable exists. I guess your sketch includes stdarg and this is found in the wrong directory.
Can you build in the Arduino IDE? If so please enable the verbose output and check the compilation commands there.
Can you perhaps attach the sketch here?
I'm trying to build under Ubuntu in the Windows 10 Subsystem for Linux, if that matters.
The build environment can be reproduced like this:
git clone https://github.com/Azure/azure-iot-arduino.git
git clone https://github.com/Azure/azure-iot-arduino-utility.git
git clone https://github.com/Azure/azure-iot-arduino-protocol-http.git
cp -r azure-iot-arduino/examples/esp8266/simplesample_http .
Within the simplesample_http
directory I created a shell script build.sh
that I'm using to start the build:
$ cd simplesample_http/
$ cat build.sh
#!/bin/bash
: ${MAKE_ROOT:="/mnt/e/Users/stm/Documents/GitHub/makeEspArduino"}
: ${ESP_ROOT:="/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/"}
: ${UPLOAD_PORT:="/dev/ttyS4"}
: ${FLASH_DEF:="512K64"}
make -f "${MAKE_ROOT}/makeEspArduino.mk" \
SKETCH="simplesample_http.ino" \
ESP_ROOT=${ESP_ROOT} \
UPLOAD_PORT=${UPLOAD_PORT} \
FLASH_DEF=${FLASH_DEF} \
LIBS="../azure-iot-arduino/src ../azure-iot-arduino-utility/src ../azure-iot-arduino-protocol-http/src /mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266/libraries" \
EXCLUDE_DIRS="../azure-iot-arduino/examples ../azure-iot-arduino-utility/examples ../azure-iot-arduino-protocol-http/examples" \
"$@"
$ ./build.sh SINGLE_THREAD=1
abi.cpp
In file included from /mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include/stdlib.h:11:0,
from /mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//cores/esp8266/abi.cpp:19:
/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include/stdio.h:158:18: error: '__gnuc_va_list' has not been declared
#define __VALIST __gnuc_va_list
^
/mnt/e/Users/stm/Documents/GitHub/Arduino-esp8266//tools/sdk/libc/xtensa-lx106-elf/include/_ansi.h:65:35: note: in definition of macro '_EXFUN'
#define _EXFUN(name, proto) name proto
<... many more compiler errors ...>
I did not yet try to build the sketch from within the Arduino IDE (after all that is what I wanted to avoid by using makeEspArduino 😄 ), but I will do that next.
Can you build in the Arduino IDE? If so please enable the verbose output and check the compilation commands there.
Yes, building the sketch with the Arduino IDE under Windows works. I opened the simplesample_http
sketch in the Arduino IDE and added the three libraries as ZIP files to the sketch.
For comparison the build command generated by the Arduino IDE for the first module abi.cpp
looks like this:
"C:\Users\Stephan Mühlstrasser\Documents\ArduinoData\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Users\Stephan Mühlstrasser\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/include" "-IC:\Users\Stephan Mühlstrasser\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/lwip2/include" "-IC:\Users\Stephan Mühlstrasser\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.0/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\Users\STEPHA~1\AppData\Local\Temp\arduino_build_491206/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DARDUINO=10805 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_GENERIC" -DESP8266 "-IC:\Users\Stephan Mühlstrasser\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.0\cores\esp8266" "-IC:\Users\Stephan Mühlstrasser\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.0\variants\generic" "C:\Users\Stephan Mühlstrasser\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.0\cores\esp8266\abi.cpp" -o "C:\Users\STEPHA~1\AppData\Local\Temp\arduino_build_491206\core\abi.cpp.o"
LIBS should be:
../azure-iot-arduino/src ../azure-iot-arduino-utility/src ../azure-iot-arduino-protocol-http/src $(ESP_ROOT)/libraries/ESP8266WiFi
This worked for me (under true Ubuntu)
Also avoid putting the gits underneath the sketch directory, you can just cd into:
azure-iot-arduino/examples/esp8266/simplesample_http
and start the build from there (changing the ../ path above to ../../../..) and then just add LIBS= to the make command line. No need for a special batch or makefile in this case
LIBS should be:
../azure-iot-arduino/src ../azure-iot-arduino-utility/src ../azure-iot-arduino-protocol-http/src $(ESP_ROOT)/libraries/ESP8266WiFi
This worked for me (under true Ubuntu)
This also worked now for me as well with Ubuntu in the Windows subsystem for Linux, thank you!
Also avoid putting the gits underneath the sketch directory, you can just cd into:
azure-iot-arduino/examples/esp8266/simplesample_http
and start the build from there (changing the ../ path above to ../../../..) and then just add LIBS= to the make command line. No need for a special batch or makefile in this case
I did copy out the simplesample_http directory in anticipation of my real sketch that will use the libraries.