Page 1 of 1

ESP32 使用idf.py build 后,提示 undefined reference to `app_main'

Posted: Tue Jan 26, 2021 9:18 am
by twtxgd
/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/freertos/libfreertos.a(port_common.c.obj):(.literal.main_task+0x14): undefined reference to `app_main'
/home/rehu/esp/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/freertos/libfreertos.a(port_common.c.obj): in function `main_task':
/home/rehu/esp/esp-idf/components/freertos/port/port_common.c:129: undefined reference to `app_main'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

Re: ESP32 使用idf.py build 后,提示 undefined reference to `app_main'

Posted: Tue Jan 26, 2021 10:56 am
by ESP_morris
因为你的应用程序没有提供app_main函数.这是用户程序的入口.请参考idf中的example代码