undefined reference to `app_main'
See original GitHub issueOS : macOS 10.11.6 PlatformIO: 1.7.1(IDE), 3.2.1(Core)
use espidf-hello-world example, then come error below(I can use Arduino example normally):
Indexing .pioenvs/esp32dev/libtcpip_adapter.a
Linking .pioenvs/esp32dev/firmware.elf
.pioenvs/esp32dev/libesp32.a(cpu_start.o):(.literal.main_task+0x0): undefined reference to `app_main'
.pioenvs/esp32dev/libesp32.a(cpu_start.o): In function `main_task':
/Users/linjinhui/.platformio/packages/framework-espidf/components/esp32/cpu_start.c:169: undefined reference to `app_main'
collect2: error: ld returned 1 exit status
*** [.pioenvs/esp32dev/firmware.elf] Error 1
========================== [ERROR] Took 15.54 seconds ==========================
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
undefined reference to `app_main' - ESP32 Forum
Re: undefined reference to `app_main' I have the exact same issue and I am not using CPP file.
Read more >error:undefined reference to `app_main' · Issue #899 - GitHub
the main problem is undefined reference to `app_main' and I also refer to another same problem whose cause is not copying the component.mk...
Read more >How to fix ESP-IDF 'undefined reference to app_main'
How to fix ESP-IDF 'undefined reference to app_main'. Problem: You are trying to compile your C/C++ ESP8266/ESP32 firmware using the ESP-IDF ...
Read more >ESP32 & freertos & port_common.o & undefined reference to ...
Hello,. When i link my program, i have this error : (i have a main.cpp with an entry named void app_main()).
Read more >undefined reference to _app_main - Stack Overflow
As the first error is a "Multiple definition of main" you must decide first which of the 2 main function you have is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
should add
extern "C"
in front ofapp_main
I had this error when I switched from compiling with platformio (vscode) to compiling with mingw32. The problem was that I had the code in the ./src folder instead of the ./main folder.