idf4.4 在cmakelists.txt 中设置了 main.cpp 依然找不到 app_main ?

lwshowl
Posts: 27
Joined: Sat Jun 05, 2021 7:33 am

idf4.4 在cmakelists.txt 中设置了 main.cpp 依然找不到 app_main ?

Postby lwshowl » Sat May 28, 2022 10:02 am

以前在4.2 中可以成功编译,现在换到idf 4.4 后 找不到app_main ?

/../riscv32-esp-elf/bin/ld.exe: esp-idf/freertos/libfreertos.a(port_common.c.obj): in function `main_task':
H:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/port_common.c:117: undefined reference to `app_main'

以下是 cmakelists
set(SOURCES ./Src/main.cpp
./Src/ringbufferUart.cpp
./Src/app_tasks.cpp
./Src/md5.cpp
./Src/util.cpp
./Src/app_ble.c
./Src/SI522A_interface.c
./Src/SI522A_App.c
./Src/myspi.c)


idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS "." "Inc"
REQUIRES freertos esp_common nvs_flash bt)

请问有人可以指点一下吗

lwshowl
Posts: 27
Joined: Sat Jun 05, 2021 7:33 am

Re: idf4.4 在cmakelists.txt 中设置了 main.cpp 依然找不到 app_main ?

Postby lwshowl » Sat May 28, 2022 11:48 am

把源文件的父文件夹 改名为main 后 又可以编译了

ESP_Yake
Posts: 109
Joined: Mon Mar 06, 2017 12:23 pm

Re: idf4.4 在cmakelists.txt 中设置了 main.cpp 依然找不到 app_main ?

Postby ESP_Yake » Tue May 31, 2022 6:15 am

可以看下我们文档中说明如何构建一个项目: https://docs.espressif.com/projects/esp ... ystem.html

Who is online

Users browsing this forum: No registered users and 62 guests