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

twtxgd
Posts: 3
Joined: Tue Jan 26, 2021 9:10 am

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

Postby twtxgd » Tue Jan 26, 2021 9:18 am

/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

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

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

Postby ESP_morris » Tue Jan 26, 2021 10:56 am

因为你的应用程序没有提供app_main函数.这是用户程序的入口.请参考idf中的example代码

Who is online

Users browsing this forum: Bing [Bot] and 123 guests