-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linking CXX executable IDF 4.4.4 (IDFGH-9430) #10798
Comments
Please check if your app_main function is defined with C linkage: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/cplusplus.html#defining-app-main-in-c |
Thanks for replying but I did it before and repeat today. It is not working for me. Error is the same as I wrote before. |
To debug the such an error, i would suggest to do the following steps:
|
Hello, I did first point I commented wi-fi componet to be missed and building error was not reported. Compiler finnished its job with the same error as I reported it yesterday. |
I see, this probably means that the source file where app_main is defined is not compiled. Since we can't see your project, please share some further information:
|
Hi. App_main is defined in get_started.c in component called main. idf_component_register(SRCS "get_started.c" |
I think this sets the components to just the I think setting COMPONENT_DIRS here is unnecessary, since the default behavior of the build system is to include the components found in: IDF /components subdirectory, project /components subdirectory, and project /main subdirectory. You can simplify it as: cmake_minimum_required(VERSION 3.16)
set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/components_mdf")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(Espnow_Slave_1.1) Afterwards, check CMake output where the list of components being built is printed. (Look for |
Hi, I did as you suggested and I removed that line set(COMPONENT_DIRS "$ENV{IDF_PATH}/components" ) I got error: _[0/1] Re-running CMake...
Call Stack (most recent call first): -- Configuring incomplete, errors occurred! Thanks for replying |
This means that one of the components in your project has a dependency (declared in idf_component.yml file) on espressif/coap component from the IDF Component Registry (https://components.espressif.com/components/espressif/coap). At the same time, IDF v4.4.x has |
I had coap file in my project and one was removed. Undefined refrence error "app_main" still is. |
Okay, in that case going back to the previous list of troubleshooting steps:
|
Thanks for replying. I lost hope to get any solution to solve my problem I deleted all files associated with Esp idf. I installed new version Espidf 5.0.1. and decided to rewrite some components and app for new version. I started new mdf project and problem is
CMake Error at C:/Users/Janek/esp/esp-idf/tools/cmake/build.cmake:245 (message):
Diagnostic info: C:/Users/Janek/esp/esp-idf/tools/split_paths_by_spaces.py was invoked in C:\Users\Janek\Projekty\VSC_proj\espidf_v5.0.1\Test_v5_Espnow with arguments: ['--var-name=EXTRA_COMPONENCMake Error at C:/Users/Janek/esp/esp-idf/tools/cmake/project.cmake:100 (message):
CMake Error at C:/Users/Janek/esp/esp-idf/tools/cmake/build.cmake:245 (message):
CMake Error at C:/Users/Janek/esp/esp-idf/tools/cmake/build.cmake:245 (message):
Running cmake in directory c:\users\janek\projekty\vsc_proj\espidf_v5.0.1\test_v5_espnow\build |
I think the issue might be that ESP-MDF is compatible with IDF v4.3.1, not with v5.0.1: https://github.com/espressif/esp-mdf#quick-start The issue about ESP-MDF incompatibility with IDF v5.x was reported in the ESP-MDF repository here: espressif/esp-mdf#325. |
Hi, thanks for your help. In this case I need to downgrade ESP IDF to v4.1. I hope ESP-MDF compability with v5.0 will be improved as soon as possible. |
@Jurand1 Please not that IDF v4.1 is not maintained anymore. IDF version v4.3 would be the suggested one. Unless there is something else that we can do from the IDF side, could we close this issue then? |
Answers checklist.
General issue report
Hi, I am using ESP IDF 4.4.4 and the same problem I had with IDF v5.0. I am using idf and mdf components along. Since two weeks I have been trying to solve linking executable problem but without any succses. Please read below-
1/6] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D C:\Users\Janek\Projekty\VSC_proj\Espnow_Slave_1.1\build\bootloader\esp-idf\esptool_py && C:\Espressif\python_env\idf4.4_py3.8_env\Scripts\python.exe C:/Users/Janek/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 C:/Users/Janek/Projekty/VSC_proj/Espnow_Slave_1.1/build/bootloader/bootloader.bin"
Bootloader binary size 0x63b0 bytes. 0xc50 bytes (11%) free.
[2/4] Linking CXX executable Espnow_Slave_1.1.elf
FAILED: Espnow_Slave_1.1.elf
cmd.exe /C "cd . && C:\Espressif\tools\xtensa-esp32-elf\esp-2021r2-patch5-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address @CMakeFiles\Espnow_Slave_1.1.elf.rsp -o Espnow_Slave_1.1.elf && cd ."
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/freertos/libfreertos.a(port_common.c.obj):(.literal.main_task+0x1c): undefined reference to
app_main' c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/freertos/libfreertos.a(port_common.c.obj): in function
main_task':C:/Users/Janek/esp/esp-idf/components/freertos/port/port_common.c:135: undefined reference to `app_main'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Thanks for replynig and any sugetions to resolve problem.
The text was updated successfully, but these errors were encountered: