Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By erl
#3115 I'm having problems building after pulling the latest from git.

I do a clean pull, and I get lots of compilation warnings, the first are:
Code: Select allIn file included from /home/esp8266/src/esp8266-frankenstein/src/test.c:10:0:
/home/esp8266/src/esp8266-frankenstein/src/microrl.h:6:0: warning: "true" redefined [enabled by default]
 #define true  1
 ^
In file included from /home/esp8266/src/esp8266-frankenstein/antares/src/arch/esp8266/include-sdk/ets_sys.h:11:0,
                 from /home/esp8266/src/esp8266-frankenstein/src/test.c:1:
/home/esp8266/src/esp8266-frankenstein/antares/src/arch/esp8266/include-sdk/c_types.h:83:0: note: this is the location of the previous definition
 #define true            (1)
 ^
In file included from /home/esp8266/src/esp8266-frankenstein/src/test.c:10:0:
/home/esp8266/src/esp8266-frankenstein/src/microrl.h:7:0: warning: "false" redefined [enabled by default]
 #define false 0
 ^
In file included from /home/esp8266/src/esp8266-frankenstein/antares/src/arch/esp8266/include-sdk/ets_sys.h:11:0,
                 from /home/esp8266/src/esp8266-frankenstein/src/test.c:1:
/home/esp8266/src/esp8266-frankenstein/antares/src/arch/esp8266/include-sdk/c_types.h:84:0: note: this is the location of the previous definition
 #define false           (0)
 ^
/home/esp8266/src/esp8266-frankenstein/src/test.c: In function 'request_default_environment':
/home/esp8266/src/esp8266-frankenstein/src/test.c:42:3: warning: implicit declaration of function 'env_insert' [-Wimplicit-function-declaration]
   env_insert(defaultenv[i].key, defaultenv[i].value);


I get some stuff about 'Pokerface'
Code: Select allIn file included from /home/esp8266/src/esp8266-frankenstein/src/cmd_send.c:7:0:
/home/esp8266/src/esp8266-frankenstein/antares/src/arch/esp8266/include-sdk/espconn.h:209:7: note: expected 'espconn_reconnect_callback' but argument is of type 'void (*)(struct pokerface *, sint8)'
 sint8 espconn_regist_reconcb(struct espconn *espconn, espconn_reconnect_callback recon_cb);
       ^


As far as I can see, they are all warnings (but over 1000 lines of them).

At the end I get link errors:

Code: Select all/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lmain
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lnet80211
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lphy
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lpp
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lwpa
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lssl
/opt/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -llwip
collect2: error: ld returned 1 exit status
make: *** [images/antares.elf] Error 1


I'm not sure what's going on. I'm running on the official Virtualbox VM with the development tools. I was building successfully before the latest pull.

What might be the problem?
User avatar
By erl
#3153 I've been banging my head against this for a number of hours now...

I've built the esp-open-sdk (after having to enlarge the VM's disk to fit the build). I tried to build it standalone and not.

I'm still getting link errors:
Code: Select all  [LD]        images/antares.elf
/home/esp8266/src/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lmain
/home/esp8266/src/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lnet80211
/home/esp8266/src/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lphy
/home/esp8266/src/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lpp
/home/esp8266/src/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lwpa
/home/esp8266/src/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lssl
/home/esp8266/src/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -llwip
collect2: error: ld returned 1 exit status
make: *** [images/antares.elf] Error 1


Should I build the esp-open-sdk standalone or not?
What exactly is Antares and how does it relate to Franekstein?
Should I be building this in the sdk's app directory? I didn't have to before.
How do I get Frankenstein to use the esp-open-sdk SDK libraries? They are in /home/esp8266/src/esp-open-sdk/sdk/lib.
I tried adding:
Code: Select allCONFIG_LDFLAGS="-L/home/esp8266/src/esp-open-sdk/sdk/lib"

manually to .config in esp8266-frankenstein to no avail.

Could you please give detailed build instructions on a fresh system? Thanks. I don't know what I'm missing.