- Thu Jan 08, 2015 11:11 am
#6693
Thank you @jcmvbkbc
What is pp library? After adding it the linke complains that upgrade_ssl is missing and after commenting it out from LIBS in Makefile linker fails bacause of missing reference to user_init from wdt_init
Code: Select allmkdir -p build/driver
mkdir -p build/user
mkdir -p firmware
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++ -Idriver -Iuser -Idriver/include -Iuser/include -Iinclude -I/opt/Espressif/include/ -I/opt/Espressif/ESP8266_SDK/include -I/opt/Espressif/ESP8266_SDK/include/json -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH -fno-rtti -fno-exceptions -c user/user_main.cpp -o build/user/user_main.o
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin/xtensa-lx106-elf-ar cru build/app_app.a build/user/user_main.o
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc -L/opt/Espressif/ESP8266_SDK/lib -T/opt/Espressif/ESP8266_SDK/ld/eagle.app.v6.ld -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static -Wl,--start-group -lc -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lupgrade -lmain -lpp build/app_app.a -Wl,--end-group -o build/app.out
/opt/Espressif/ESP8266_SDK/lib/libmain.a(app_main.o): In function `wdt_init':
(.irom0.text+0x374): undefined reference to `user_init'
/opt/Espressif/ESP8266_SDK/lib/libmain.a(app_main.o): In function `wdt_init':
(.irom0.text+0x4cf): undefined reference to `user_init'
collect2: error: ld returned 1 exit status
make: *** [build/app.out] Error 1
Why could that be? I've got super simple source file which looks like this:
Code: Select all#include "ets_sys.h"
#include "osapi.h"
#include "gpio.h"
#include "os_type.h"
#include "user_config.h"
//#include <iostream>
#include <vector>
void ICACHE_FLASH_ATTR
user_init()
{
// os_printf("user_init()\r\n");
std::vector < int > vec;
int x = 0;
for( int i = 0; i < 10; i++ ){
vec.push_back( x );
x = x ;
}
for( int i = 0; i < vec.size(); i++ ){
//os::printf(vec[i]);
//std::cout << vec[ i ] << std::endl;
}
}
Also if I uncomment the
os_printf function call which I've used previously compiler throws the error which points to a valid user_init reference. Do you know why could these be an issue?
Code: Select allmkdir -p build/driver
mkdir -p build/user
mkdir -p firmware
/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++ -Idriver -Iuser -Idriver/include -Iuser/include -Iinclude -I/opt/Espressif/include/ -I/opt/Espressif/ESP8266_SDK/include -I/opt/Espressif/ESP8266_SDK/include/json -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH -fno-rtti -fno-exceptions -c user/user_main.cpp -o build/user/user_main.o
user/user_main.cpp: In function 'void user_init()':
user/user_main.cpp:12:32: error: 'os_printf' was not declared in this scope
os_printf("user_init()\r\n");
^
make: *** [build/user/user_main.o] Error 1