Hi, I'm trying to use the following component: "https://github.com/bitfixer/esp32s3vga/tree/main". I created the folder for components and made the necessary changes in the CMakeLists.txt to add it. The problem occurs when I try to build it: if I keep the main.c file as a C file, the compiler treats VGA.h as a C file as well and doesn't recognize the type name 'class'. However, if I change main.c to main.cpp, the compiler recognizes 'class' but then I get the error "undefined reference to 'app_main'".
I’m not sure why it won't let me compile in C++, even after changing the CMakeLists.txt to reference main.cpp. If anyone knows how to work with C++ files in this context, could you help me out?
Create and use external component
-
- Posts: 109
- Joined: Thu Oct 03, 2019 10:52 pm
- Contact:
Re: Create and use external component
If you change main.c to main.cpp, the following changes are required.
https://docs.espressif.com/projects/esp ... splus.html
https://docs.espressif.com/projects/esp ... splus.html
-
- Posts: 1698
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Create and use external component
Specifically, in C++, app_main() must be declared extern "C", see https://docs.espressif.com/projects/esp ... -main-in-c
Who is online
Users browsing this forum: Bing [Bot] and 214 guests