Hi, when I tried to build simple mongoose example for ESP8266 I faced with errors during linking.
This errors looks like they related to stdlib.
See my build output and makefile below:
My build output
```
- building ESP8266-rtos-hal...
make clean
make[1]: Entering directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal'
- cleaning out/obj, out/lst, out/bin...
(out/obj:&(rd /s /q "out/obj" 2> NUL))&
(out/lst:&(rd /s /q "out/lst" 2> NUL))&
(out/bin:&(rd /s /q "out/bin" 2> NUL))&
make[1]: Leaving directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal'
make dirs
make[1]: Entering directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal'
- making out/obj, out/lst, out/bin...
(out/obj:&(mkdir "out/obj" 2> NUL))&
(out/lst:&(mkdir "out/lst" 2> NUL))&
(out/bin:&(mkdir "out/bin" 2> NUL))&
make[1]: Leaving directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal'
make out/bin/ESP8266-rtos-hal.elf
make[1]: Entering directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal'
- compiling src/main.c...
xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/main.c -o out/obj/main.o
- compiling src/common/macros.c...
xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/common/macros.c -o out/obj/macros.o
- compiling src/drv/drv_di.c...
xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/drv/drv_di.c -o out/obj/drv_di.o
- compiling src/extra-lib/xprintf/xprintf.c...
xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/extra-lib/xprintf/xprintf.c -o out/obj/xprintf.o
- compiling src/extra-lib/mongoose/esp_libc.c...
xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/extra-lib/mongoose/esp_libc.c -o out/obj/esp_libc.o
- compiling src/extra-lib/mongoose/mongoose.c...
xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/extra-lib/mongoose/mongoose.c -o out/obj/mongoose.o
- compiling src/hal/hal_gpio.c...
xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/hal/hal_gpio.c -o out/obj/hal_gpio.o
- compiling src/hal/hal_systick.c...
xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/hal/hal_systick.c -o out/obj/hal_systick.o
- compiling src/hal/hal_tim.c...
xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/hal/hal_tim.c -o out/obj/hal_tim.o
- linking...
xtensa-lx106-elf-gcc -Teagle.app.v6.ld -Lsrc/hal/ESP8266_SDK/lib -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lcirom -lcrypto -lespconn -lespnow -lfreertos -lgcc -ljson -llwip -lmain -lnet80211 -lnopoll -lphy -lpp -lpwm -lspiffs -lssc -lwpa -lwps -lhal -Wl,--end-group -Wl,-Map="out/lst/ESP8266-rtos-hal.map",--cref out/obj/main.o out/obj/macros.o out/obj/drv_di.o out/obj/xprintf.o out/obj/esp_libc.o out/obj/mongoose.o out/obj/hal_gpio.o out/obj/hal_systick.o out/obj/hal_tim.o -o out/bin/ESP8266-rtos-hal.elf
f:/soft/1-ready/sublimetext/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: out/bin/ESP8266-rtos-hal.elf section `.text' will not fit in region `iram1_0_seg'
out/obj/mongoose.o: In function `blk0':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1226: undefined reference to `__moddi3'
out/obj/mongoose.o: In function `c_itoa':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1510: undefined reference to `__moddi3'
out/obj/mongoose.o: In function `parse_uri_component':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:4809: undefined reference to `__ctype_ptr__'
out/obj/mongoose.o: In function `mg_socket_if_get_conn_addr':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3768: undefined reference to `snprintf'
out/obj/mongoose.o: In function `mg_hexdump_n':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9370: undefined reference to `snprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9372: undefined reference to `snprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9373: undefined reference to `snprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9380: undefined reference to `snprintf'
out/obj/mongoose.o:F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9383: more undefined references to `snprintf' follow
out/obj/mongoose.o: In function `mg_open_listening_socket':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `fprintf'
out/obj/mongoose.o: In function `mg_socket_if_remove_conn':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `fprintf'
out/obj/mongoose.o: In function `mg_tun_if_connect_udp':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `vfprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `fputc'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `fflush'
out/obj/mongoose.o: In function `cs_log_print_prefix':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:300: undefined reference to `vfprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:301: undefined reference to `fputc'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:309: undefined reference to `fflush'
out/obj/mongoose.o: In function `cs_base64_encode':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:458: undefined reference to `fputc'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:458: undefined reference to `fputc'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:458: undefined reference to `fputc'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:459: undefined reference to `fputc'
out/obj/mongoose.o: In function `cs_fprint_base64':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:474: undefined reference to `fputc'
out/obj/mongoose.o: In function `cs_base64_decode':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:530: undefined reference to `gettimeofday'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:531: undefined reference to `gettimeofday'
out/obj/mongoose.o: In function `MD5_Final':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:977: undefined reference to `__assert_func'
out/obj/mongoose.o: In function `mbuf_resize':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1050: undefined reference to `__assert_func'
out/obj/mongoose.o: In function `mbuf_trim':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1059: undefined reference to `__assert_func'
out/obj/mongoose.o: In function `cs_to_hex':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1754: undefined reference to `sscanf'
out/obj/mongoose.o: In function `cs_md5':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:992: undefined reference to `sscanf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1001: undefined reference to `sscanf'
out/obj/mongoose.o: In function `cs_from_hex':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1775: undefined reference to `sscanf'
out/obj/mongoose.o: In function `mg_ncasecmp':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1804: undefined reference to `sscanf'
out/obj/mongoose.o: In function `mg_vcasecmp':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1148: undefined reference to `vsnprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1154: undefined reference to `vsnprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1154: undefined reference to `vsnprintf'
out/obj/mongoose.o: In function `mg_parse_address':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:2367: undefined reference to `vsnprintf'
out/obj/mongoose.o: In function `mg_url_decode':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6396: undefined reference to `snprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6397: undefined reference to `sscanf'
out/obj/mongoose.o: In function `mg_http_parse_header':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6518: undefined reference to `strdup'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6524: undefined reference to `strdup'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6522: undefined reference to `atoi'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6542: undefined reference to `strtoll'
out/obj/mongoose.o: In function `mg_get_http_basic_auth':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6545: undefined reference to `atoi'
out/obj/mongoose.o: In function `mg_parse_multipart':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:7776: undefined reference to `strtoll'
out/obj/mongoose.o: In function `mg_register_http_endpoint':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:7806: undefined reference to `snprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:7812: undefined reference to `snprintf'
out/obj/mongoose.o: In function `mg_skip':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9211: undefined reference to `fputs'
out/obj/mongoose.o: In function `mg_parse_http':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5282: undefined reference to `fputs'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5295: undefined reference to `fclose'
out/obj/mongoose.o: In function `mg_http_parse_headers':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5247: undefined reference to `fprintf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5250: undefined reference to `fputs'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5261: undefined reference to `fclose'
out/obj/mongoose.o: In function `mg_call':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:2030: undefined reference to `__assert_func'
out/obj/mongoose.o: In function `mg_if_poll':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:2087: undefined reference to `strerror'
out/obj/mongoose.o: In function `mg_mgr_free':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:2208: undefined reference to `strerror'
out/obj/mongoose.o: In function `mg_mgr_handle_conn':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3514: undefined reference to `snprintf'
out/obj/mongoose.o: In function `mg_socket_if_poll':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3649: undefined reference to `rand'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3678: undefined reference to `rand'
out/obj/mongoose.o: In function `mg_printf_html_escape':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6497: undefined reference to `sscanf'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6505: undefined reference to `sscanf'
out/obj/mongoose.o: In function `mg_ws_handler':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9058: undefined reference to `__assert_func'
out/obj/mongoose.o: In function `mg_match_prefix_n':
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9494: undefined reference to `rand'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9498: undefined reference to `rand'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9498: undefined reference to `rand'
F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9501: undefined reference to `rand'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [out/bin/ESP8266-rtos-hal.elf] Error 1
make[1]: Leaving directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal'
make: *** [all] Error 2
[Finished in 8.1s with exit code 2]
```
Hi, when I tried to build simple mongoose example for ESP8266 I faced with errors during linking. This errors looks like they related to stdlib. See my build output and makefile below:
My build output
``` - building ESP8266-rtos-hal... make clean make[1]: Entering directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal' - cleaning out/obj, out/lst, out/bin... (out/obj:&(rd /s /q "out/obj" 2> NUL))& (out/lst:&(rd /s /q "out/lst" 2> NUL))& (out/bin:&(rd /s /q "out/bin" 2> NUL))& make[1]: Leaving directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal' make dirs make[1]: Entering directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal' - making out/obj, out/lst, out/bin... (out/obj:&(mkdir "out/obj" 2> NUL))& (out/lst:&(mkdir "out/lst" 2> NUL))& (out/bin:&(mkdir "out/bin" 2> NUL))& make[1]: Leaving directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal' make out/bin/ESP8266-rtos-hal.elf make[1]: Entering directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal' - compiling src/main.c... xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/main.c -o out/obj/main.o - compiling src/common/macros.c... xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/common/macros.c -o out/obj/macros.o - compiling src/drv/drv_di.c... xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/drv/drv_di.c -o out/obj/drv_di.o - compiling src/extra-lib/xprintf/xprintf.c... xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/extra-lib/xprintf/xprintf.c -o out/obj/xprintf.o - compiling src/extra-lib/mongoose/esp_libc.c... xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/extra-lib/mongoose/esp_libc.c -o out/obj/esp_libc.o - compiling src/extra-lib/mongoose/mongoose.c... xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/extra-lib/mongoose/mongoose.c -o out/obj/mongoose.o - compiling src/hal/hal_gpio.c... xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/hal/hal_gpio.c -o out/obj/hal_gpio.o - compiling src/hal/hal_systick.c... xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/hal/hal_systick.c -o out/obj/hal_systick.o - compiling src/hal/hal_tim.c... xtensa-lx106-elf-gcc -D__ets__ -DICACHE_FLASH -DUSE_US_TIMER -DRTOS_SDK -DMG_ESP8266 -DCS_PLATFORM=CS_P_ESP8266 -Isrc -Isrc/common -Isrc/drv -Isrc/extra-lib -Isrc/extra-lib/xprintf -Isrc/extra-lib/mongoose -Isrc/hal -Isrc/hal/ESP8266_SDK/extra_include -Isrc/hal/ESP8266_SDK/extra_include/xtensa -Isrc/hal/ESP8266_SDK/extra_include/xtensa/config -Isrc/hal/ESP8266_SDK/extra_include/xtensa/tie -Isrc/hal/ESP8266_SDK/include -Isrc/hal/ESP8266_SDK/include/espressif -Isrc/hal/ESP8266_SDK/include/espressif/esp8266 -Isrc/hal/ESP8266_SDK/include/freertos -Isrc/hal/ESP8266_SDK/include/json -Isrc/hal/ESP8266_SDK/include/lwip -Isrc/hal/ESP8266_SDK/include/lwip/ipv4 -Isrc/hal/ESP8266_SDK/include/lwip/ipv6 -Isrc/hal/ESP8266_SDK/include/mbedtls -Isrc/hal/ESP8266_SDK/include/nopoll -Isrc/hal/ESP8266_SDK/include/openssl -Isrc/hal/ESP8266_SDK/include/spiffs -Isrc/hal/ESP8266_SDK/include/ssl -Os -g -std=gnu99 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -mno-serialize-volatile -c src/hal/hal_tim.c -o out/obj/hal_tim.o - linking... xtensa-lx106-elf-gcc -Teagle.app.v6.ld -Lsrc/hal/ESP8266_SDK/lib -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lcirom -lcrypto -lespconn -lespnow -lfreertos -lgcc -ljson -llwip -lmain -lnet80211 -lnopoll -lphy -lpp -lpwm -lspiffs -lssc -lwpa -lwps -lhal -Wl,--end-group -Wl,-Map="out/lst/ESP8266-rtos-hal.map",--cref out/obj/main.o out/obj/macros.o out/obj/drv_di.o out/obj/xprintf.o out/obj/esp_libc.o out/obj/mongoose.o out/obj/hal_gpio.o out/obj/hal_systick.o out/obj/hal_tim.o -o out/bin/ESP8266-rtos-hal.elf f:/soft/1-ready/sublimetext/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld.exe: out/bin/ESP8266-rtos-hal.elf section `.text' will not fit in region `iram1_0_seg' out/obj/mongoose.o: In function `blk0': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1226: undefined reference to `__moddi3' out/obj/mongoose.o: In function `c_itoa': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1510: undefined reference to `__moddi3' out/obj/mongoose.o: In function `parse_uri_component': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:4809: undefined reference to `__ctype_ptr__' out/obj/mongoose.o: In function `mg_socket_if_get_conn_addr': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3768: undefined reference to `snprintf' out/obj/mongoose.o: In function `mg_hexdump_n': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9370: undefined reference to `snprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9372: undefined reference to `snprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9373: undefined reference to `snprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9380: undefined reference to `snprintf' out/obj/mongoose.o:F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9383: more undefined references to `snprintf' follow out/obj/mongoose.o: In function `mg_open_listening_socket': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `fprintf' out/obj/mongoose.o: In function `mg_socket_if_remove_conn': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `fprintf' out/obj/mongoose.o: In function `mg_tun_if_connect_udp': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `vfprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `fputc' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3266: undefined reference to `fflush' out/obj/mongoose.o: In function `cs_log_print_prefix': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:300: undefined reference to `vfprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:301: undefined reference to `fputc' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:309: undefined reference to `fflush' out/obj/mongoose.o: In function `cs_base64_encode': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:458: undefined reference to `fputc' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:458: undefined reference to `fputc' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:458: undefined reference to `fputc' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:459: undefined reference to `fputc' out/obj/mongoose.o: In function `cs_fprint_base64': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:474: undefined reference to `fputc' out/obj/mongoose.o: In function `cs_base64_decode': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:530: undefined reference to `gettimeofday' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:531: undefined reference to `gettimeofday' out/obj/mongoose.o: In function `MD5_Final': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:977: undefined reference to `__assert_func' out/obj/mongoose.o: In function `mbuf_resize': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1050: undefined reference to `__assert_func' out/obj/mongoose.o: In function `mbuf_trim': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1059: undefined reference to `__assert_func' out/obj/mongoose.o: In function `cs_to_hex': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1754: undefined reference to `sscanf' out/obj/mongoose.o: In function `cs_md5': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:992: undefined reference to `sscanf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1001: undefined reference to `sscanf' out/obj/mongoose.o: In function `cs_from_hex': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1775: undefined reference to `sscanf' out/obj/mongoose.o: In function `mg_ncasecmp': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1804: undefined reference to `sscanf' out/obj/mongoose.o: In function `mg_vcasecmp': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1148: undefined reference to `vsnprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1154: undefined reference to `vsnprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:1154: undefined reference to `vsnprintf' out/obj/mongoose.o: In function `mg_parse_address': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:2367: undefined reference to `vsnprintf' out/obj/mongoose.o: In function `mg_url_decode': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6396: undefined reference to `snprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6397: undefined reference to `sscanf' out/obj/mongoose.o: In function `mg_http_parse_header': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6518: undefined reference to `strdup' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6524: undefined reference to `strdup' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6522: undefined reference to `atoi' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6542: undefined reference to `strtoll' out/obj/mongoose.o: In function `mg_get_http_basic_auth': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6545: undefined reference to `atoi' out/obj/mongoose.o: In function `mg_parse_multipart': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:7776: undefined reference to `strtoll' out/obj/mongoose.o: In function `mg_register_http_endpoint': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:7806: undefined reference to `snprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:7812: undefined reference to `snprintf' out/obj/mongoose.o: In function `mg_skip': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9211: undefined reference to `fputs' out/obj/mongoose.o: In function `mg_parse_http': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5282: undefined reference to `fputs' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5295: undefined reference to `fclose' out/obj/mongoose.o: In function `mg_http_parse_headers': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5247: undefined reference to `fprintf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5250: undefined reference to `fputs' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:5261: undefined reference to `fclose' out/obj/mongoose.o: In function `mg_call': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:2030: undefined reference to `__assert_func' out/obj/mongoose.o: In function `mg_if_poll': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:2087: undefined reference to `strerror' out/obj/mongoose.o: In function `mg_mgr_free': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:2208: undefined reference to `strerror' out/obj/mongoose.o: In function `mg_mgr_handle_conn': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3514: undefined reference to `snprintf' out/obj/mongoose.o: In function `mg_socket_if_poll': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3649: undefined reference to `rand' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:3678: undefined reference to `rand' out/obj/mongoose.o: In function `mg_printf_html_escape': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6497: undefined reference to `sscanf' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:6505: undefined reference to `sscanf' out/obj/mongoose.o: In function `mg_ws_handler': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9058: undefined reference to `__assert_func' out/obj/mongoose.o: In function `mg_match_prefix_n': F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9494: undefined reference to `rand' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9498: undefined reference to `rand' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9498: undefined reference to `rand' F:\electronics\sw\proj\sublimetext-projects\simple_hal\ESP8266-rtos-hal/src/extra-lib/mongoose/mongoose.c:9501: undefined reference to `rand' collect2.exe: error: ld returned 1 exit status make[1]: *** [out/bin/ESP8266-rtos-hal.elf] Error 1 make[1]: Leaving directory `F:/electronics/sw/proj/sublimetext-projects/simple_hal/ESP8266-rtos-hal' make: *** [all] Error 2 [Finished in 8.1s with exit code 2] ```My makefile
``` # ************************* START USER DEFINED SECTION ************************ TARGET = ESP8266-rtos-hal LDSCRIPT = eagle.app.v6.ld DEF = __ets__ DEF += ICACHE_FLASH DEF += USE_US_TIMER # Definitions below needed for mongoose DEF += RTOS_SDK DEF += MG_ESP8266 DEF += CS_PLATFORM=CS_P_ESP8266 SRCDIR = src SRCDIR += src/common SRCDIR += src/drv SRCDIR += src/extra-lib SRCDIR += src/extra-lib/xprintf SRCDIR += src/extra-lib/mongoose SRCDIR += src/hal SRCDIR += src/hal/ESP8266_SDK/extra_include SRCDIR += src/hal/ESP8266_SDK/extra_include/xtensa SRCDIR += src/hal/ESP8266_SDK/extra_include/xtensa/config SRCDIR += src/hal/ESP8266_SDK/extra_include/xtensa/tie SRCDIR += src/hal/ESP8266_SDK/include SRCDIR += src/hal/ESP8266_SDK/include/espressif SRCDIR += src/hal/ESP8266_SDK/include/espressif/esp8266 SRCDIR += src/hal/ESP8266_SDK/include/freertos SRCDIR += src/hal/ESP8266_SDK/include/json SRCDIR += src/hal/ESP8266_SDK/include/lwip SRCDIR += src/hal/ESP8266_SDK/include/lwip/ipv4 SRCDIR += src/hal/ESP8266_SDK/include/lwip/ipv6 SRCDIR += src/hal/ESP8266_SDK/include/mbedtls SRCDIR += src/hal/ESP8266_SDK/include/nopoll SRCDIR += src/hal/ESP8266_SDK/include/openssl SRCDIR += src/hal/ESP8266_SDK/include/spiffs SRCDIR += src/hal/ESP8266_SDK/include/ssl LIBDIR = src/hal/ESP8266_SDK/lib #LIB = airkiss LIB = cirom LIB += crypto #LIB += driver LIB += espconn LIB += espnow LIB += freertos LIB += gcc LIB += json LIB += lwip LIB += main #LIB += mbedtls #LIB += mesh #LIB += minic #LIB += mirom LIB += net80211 LIB += nopoll #LIB += openssl LIB += phy LIB += pp LIB += pwm #LIB += smartconfig LIB += spiffs LIB += ssc #LIB += ssl LIB += wpa LIB += wps # libhal needed for avoiding error during linking # "undefined reference to `xthal_set_intset'" and "undefined reference to `xthal_get_ccount'" LIB += hal LINKED_OBJ = FLASHER = esptool ESPTOOL_PARAM = --port COM37 ESPTOOL_PARAM += --baud 600000 OS = Windows #OUTPUT = silent # ************************** END USER DEFINED SECTION ************************* CC = xtensa-lx106-elf-gcc CPP = xtensa-lx106-elf-g++ AS = xtensa-lx106-elf-as LD = xtensa-lx106-elf-gcc OBJCOPY = xtensa-lx106-elf-objcopy OBJDUMP = xtensa-lx106-elf-objdump SIZE = xtensa-lx106-elf-size --format=sysv INCDIR = $(addprefix -I,$(SRCDIR)) OBJDIR = out/obj BINDIR = out/bin LSTDIR = out/lst ELF = $(BINDIR)/$(TARGET).elf BIN = $(BINDIR)/$(TARGET).bin MAP = $(LSTDIR)/$(TARGET).map LSS = $(LSTDIR)/$(TARGET).lss CSRC = $(wildcard $(addsuffix /*.c,$(SRCDIR))) CPPSRC = $(wildcard $(addsuffix /*.cpp,$(SRCDIR))) ASRC = $(wildcard $(addsuffix /*.s,$(SRCDIR))) OBJS = $(addprefix $(OBJDIR)/,$(notdir $(CSRC:.c=.o) $(CPPSRC:.cpp=.o) $(ASRC:.s=.o))) DEF := $(addprefix -D,$(DEF)) LIB := $(addprefix -l,$(LIB)) CFLAGS = $(DEF) CFLAGS += $(INCDIR) CFLAGS += -Os CFLAGS += -g CFLAGS += -std=gnu99 CFLAGS += -Wpointer-arith -Wundef -Werror -Wl,-EL CFLAGS += -fno-inline-functions CFLAGS += -nostdlib CFLAGS += -mlongcalls CFLAGS += -mtext-section-literals CFLAGS += -mno-serialize-volatile CPPFLAGS = $(CFLAGS) AFLAGS = $(CFLAGS) LDFLAGS = -T$(LDSCRIPT) LDFLAGS += -L$(LIBDIR) LDFLAGS += -nostdlib LDFLAGS += -Wl,--no-check-sections LDFLAGS += -u call_user_start LDFLAGS += -Wl,-static LDFLAGS += -Wl,--start-group $(LIB) -Wl,--end-group LDFLAGS += -Wl,-Map="$(MAP)",--cref vpath %.c $(SRCDIR) vpath %.cpp $(SRCDIR) vpath %.s $(SRCDIR) ifeq ($(OUTPUT),silent) .SILENT : endif .PHONY: all erase flash clean dirs all: @echo - building $(TARGET)... $(MAKE) clean $(MAKE) dirs $(MAKE) $(ELF) $(MAKE) $(BIN) $(MAKE) $(LSS) $(SIZE) $(ELF) @echo "Errors: none" clean: @echo - cleaning $(OBJDIR), $(LSTDIR), $(BINDIR)... ifeq ($(OS),Windows) ($(OBJDIR):&(rd /s /q "$(OBJDIR)" 2> NUL))& ($(LSTDIR):&(rd /s /q "$(LSTDIR)" 2> NUL))& ($(BINDIR):&(rd /s /q "$(BINDIR)" 2> NUL))& endif ifeq ($(OS),Linux) -@rm -rf $(OBJDIR) -@rm -rf $(LSTDIR) -@rm -rf $(BINDIR) endif dirs: @echo - making $(OBJDIR), $(LSTDIR), $(BINDIR)... ifeq ($(OS),Windows) ($(OBJDIR):&(mkdir "$(OBJDIR)" 2> NUL))& ($(LSTDIR):&(mkdir "$(LSTDIR)" 2> NUL))& ($(BINDIR):&(mkdir "$(BINDIR)" 2> NUL))& endif ifeq ($(OS),Linux) -@mkdir -p $(OBJDIR) -@mkdir -p $(LSTDIR) -@mkdir -p $(BINDIR) endif erase: @echo - erasing memory with $(FLASHER)... ifeq ($(FLASHER),esptool) $(FLASHER) $(ESPTOOL_PARAM) erase_flash $(FLASHER) $(ESPTOOL_PARAM) write_flash -fs 4m -ff 40m -fm qio 0x7C000 doc/bin/esp_init_data_default.bin endif flash: @echo - programming with $(FLASHER)... ifeq ($(FLASHER),esptool) $(FLASHER) $(ESPTOOL_PARAM) write_flash -fs 4m -ff 40m -fm qio 0x00000 $(BINDIR)/$(TARGET)-0x00000.bin 0x20000 $(BINDIR)/$(TARGET)-0x20000.bin endif $(ELF): $(OBJS) $(LINKED_OBJ) @echo - linking... $(LD) $(LDFLAGS) $^ -o $@ $(BIN): $(ELF) @echo - making bin from $<... @esptool elf2image $< -o $(BINDIR)/$(TARGET)- $(LSS): $(ELF) @echo - disassembling $<... $(OBJDUMP) -dC $< >> $@ $(OBJDIR)/%.o: %.c @echo - compiling $<... $(CC) $(CFLAGS) -c $< -o $@ $(OBJDIR)/%.o: %.cpp @echo - compiling $<... $(CPP) $(CPPFLAGS) -c $< -o $@ $(OBJDIR)/%.o: %.s @echo - compiling $<... $(AS) $(AFLAGS) -c $< -o $@ ```