Compiling with Makefiles from Espressif GitHub doesn't work
Posted: Sat Jan 26, 2019 11:47 am
I oriented my project (in terms of overall structure and makefiles) on the example project simple_pair from here: https://github.com/espressif/ESP8266_NO ... r/examples
This is my structure:
I followed this tutorial on how to setup the toolchain (it is in german, I am sorry): https://cutmywire.wordpress.com/2017/05 ... omment-943
Basically all my ESP8266 toolchain stuff is in:
/opt/esp/
The compiler stuff is in:
/opt/esp/crosstool-NG/builds/xtensa-lx106-elf/bin/
The header files (e.g. osapi.h) are in:
/opt/esp/sdk/include/
I added all those directories to my PATH-Variable:
I am in my ESP8266 project folder and I am typing this into my console:
So why are the header files not found even though I added the path to $PATH?
I also tried this:
Please help
This is my structure:
I followed this tutorial on how to setup the toolchain (it is in german, I am sorry): https://cutmywire.wordpress.com/2017/05 ... omment-943
Basically all my ESP8266 toolchain stuff is in:
/opt/esp/
The compiler stuff is in:
/opt/esp/crosstool-NG/builds/xtensa-lx106-elf/bin/
The header files (e.g. osapi.h) are in:
/opt/esp/sdk/include/
I added all those directories to my PATH-Variable:
echo $PATH
/opt/esp/sdk/include:/opt/esp/sdk/:/opt/esp/crosstool-NG/builds/xtensa-lx106-elf/bin
I am in my ESP8266 project folder and I am typing this into my console:
Code: Select all
test@Device:/mnt/c/Users/Standardbenutzer/Documents/ESP8266/ESP8266$ make COMPILE=gcc
make[1]: Entering directory '/mnt/c/Users/Standardbenutzer/Documents/ESP8266/ESP8266/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -ffunction-sections -fdata-sections -fno-builtin-printf -DICACHE_FLASH -DSPI_FLASH_SIZE_MAP=0 -I include -I ../include -I ../include/eagle -I ../driver_lib/include user_main.c
user_main.c:1:19: fatal error: osapi.h: No such file or directory
#include "osapi.h"
^
compilation terminated.
make[2]: Entering directory '/mnt/c/Users/Standardbenutzer/Documents/ESP8266/ESP8266/user'
make[2]: *** user: No such file or directory. Stop.
make[2]: Leaving directory '/mnt/c/Users/Standardbenutzer/Documents/ESP8266/ESP8266/user'
../Makefile:331: recipe for target '.subdirs' failed
make[1]: *** [.subdirs] Error 2
make[1]: Leaving directory '/mnt/c/Users/Standardbenutzer/Documents/ESP8266/ESP8266/user'
Makefile:331: recipe for target '.subdirs' failed
make: *** [.subdirs] Error 2
So why are the header files not found even though I added the path to $PATH?
I also tried this:
Code: Select all
`xtensa-lx106-elf-gcc -print-prog-name=cc1` -v
ignoring nonexistent directory "/opt/esp/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/opt/esp/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/esp/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/include
/opt/esp/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/include-fixed
/opt/esp/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/include
/opt/esp/crosstool-NG/builds/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include
End of search list.
Please help