-->
Page 1 of 2

Problem with linker in Xtensa

PostPosted: Wed Feb 11, 2015 2:47 pm
by aignaciors
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??????????

Re: Problem with linker in Xtensa

PostPosted: Wed Feb 11, 2015 3:11 pm
by jcmvbkbc
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.

Re: Problem with linker in Xtensa

PostPosted: Wed Feb 11, 2015 3:22 pm
by aignaciors
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 ?

Re: Problem with linker in Xtensa

PostPosted: Wed Feb 11, 2015 3:40 pm
by jcmvbkbc
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.