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

User avatar
By aignaciors
#9493 When i try to compile the "esphttpd", the output generated was:

CC mqtt/proto.c
AR build/httpd_app.a
LD build/httpd.out
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lc
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lhal
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lphy
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lpp
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lnet80211
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lwpa
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lmain
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -llwip
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lupgrade
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lssl
collect2: error: ld returned 1 exit status


Does anyone have this problem??????????
User avatar
By jcmvbkbc
#9494
aignaciors wrote:When i try to compile the "esphttpd", the output generated was:

LD build/httpd.out
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lc
...
collect2: error: ld returned 1 exit status


Does anyone have this problem??????????

Make sure these libraries are in the path passed to linker with -L option.
I.e. find link command in your makefile, it's something like that:

$(LD) -L$(SDK_LIBDIR) ...

and check that SDK_LIBDIR is correct.
User avatar
By aignaciors
#9497
jcmvbkbc wrote:
aignaciors wrote:When i try to compile the "esphttpd", the output generated was:

LD build/httpd.out
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld: cannot find -lc
...
collect2: error: ld returned 1 exit status


Does anyone have this problem??????????

Make sure these libraries are in the path passed to linker with -L option.
I.e. find link command in your makefile, it's something like that:

$(LD) -L$(SDK_LIBDIR) ...

and check that SDK_LIBDIR is correct.


Thanks jcmvbkbc,

But it's ok, like you say, i will attach the Makefile...in fact this code was working, but when i try to install the sdk in another pc, i just cannot compile anymore. https://github.com/esp8266/esp8266-wiki/wiki/Toolchain This tutorial works 100% with sucess or i need to make standalone this https://github.com/pfalcon/esp-open-sdk ?
You do not have the required permissions to view the files attached to this post.
User avatar
By jcmvbkbc
#9499
aignaciors wrote:But it's ok, like you say, i will attach the Makefile...in fact this code was working, but when i try to install the sdk in another pc, i just cannot compile anymore.

...and you have libc.a and all other missing libraries in the /opt/Espressif/ESP8266_SDK/lib on that other machine, right?
And you don't have SDK_BASE in your environment?

aignaciors wrote:https://github.com/esp8266/esp8266-wiki/wiki/Toolchain This tutorial works 100% with sucess or i need to make standalone this https://github.com/pfalcon/esp-open-sdk ?

Well, it does one strange thing, it creates ESP8266_SDK directory, and then it mv unpacked directory into it. I believe it had to rename the unpacked directory. I'll fix that.
And I think esp-open-sdk should be preferred SDK setup method.