hi, need help there to understand cause and looking for solution.
The hello_world build under ESP-IDF v4.1 has been done and fine, so we know the build tool chain and setup has been done perfectly.
we has try to build the project ESP32_MP3_Decoder, failed and log shows following
[Codebox]
c:/users/user0/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/esp32/libesp32.a(cpu_start.c.obj):(.literal.main_task+0x18): undefined reference to `app_main'
c:/users/user0/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/esp32/libesp32.a(cpu_start.c.obj): in function `main_task':
C:/Users/user0/esp/components/esp32/cpu_start.c:551: undefined reference to `app_main'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
[/Codebox]
The project & log is hosted at Github,
https://github.com/xiaolaba/ESP32_MP3_Decoder
appreciate your help.
ESP-IDF v4.1, cpu_start.c:551: undefined reference to `app_main'
-
- Posts: 9769
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP-IDF v4.1, cpu_start.c:551: undefined reference to `app_main'
Your main/CMakeLists.txt is not a valid component CMakelists.txt. (It looks like it's a copy of your project CMakeLists.txt file).
Re: ESP-IDF v4.1, cpu_start.c:551: undefined reference to `app_main'
yes, your are absolute right. that was one of trial and error to see whether be able port the project and hopefully to remove the compilation error, but it turned out the same error produced by linker.
-
- Posts: 9769
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP-IDF v4.1, cpu_start.c:551: undefined reference to `app_main'
So do you still get that error using a proper CMakeLists.txt? Or did the error change?
Re: ESP-IDF v4.1, cpu_start.c:551: undefined reference to `app_main'
thanks for your help.
there were three options experimented to the builds, moved CMakeLists.txt back and forth, one folder at a time existed only, or put them all.
It does not matter where we put the CMakeLists.txt, still the same error.
we are new to cmake, so just scratching head hard and to try and want to know why.
there were three options experimented to the builds, moved CMakeLists.txt back and forth, one folder at a time existed only, or put them all.
Code: Select all
ESP32_MP3_Decoder\main\CMakeLists.txt
ESP32_MP3_Decoder\CMakeLists.txt
we are new to cmake, so just scratching head hard and to try and want to know why.
Re: ESP-IDF v4.1, cpu_start.c:551: undefined reference to `app_main'
In was getting this error. The reason was void pp_main(void) instead of void app _main(void)
Who is online
Users browsing this forum: No registered users and 81 guests