Dear ESP wizards,
I'm really excited to have some fun with ESP32, but so far I've gotten bogged down with the environment setup. By using official "Get Started" guide and a lot of try and error I've managed to convince Eclipse to build a "hello world" example C file without any problems and errors. However since I'm far more versed in C++, I thought I'd start with that before moving to C.
So I've modified the preprocessor compiler setting as stated in the Kolban book, changed the hello world file form main.c to main.cpp and added: extern "C" { int app_main(void); } at the begging. The result is that the project gets build without a hitch, but now those pesky "unresolved inclusion" errors are back! Grrr...
Any ideas how can I make them go away for good?
Thanks!
C++ and Eclipse woes
Re: C++ and Eclipse woes
Hi kolos,
Eclipse setup is pretty fiddly. We're working on ways to make this less painless in the future.
For now, I suggest double-checking all of the items shown in the Project Properties from the setup guide:
https://esp-idf.readthedocs.io/en/lates ... properties
Particularly if the "CDT GCC Build Output Parser" setting is wrong then it's possible CDT is only correctly indexing C files, not C++ files, to find their header paths.
After changing these settings you may need to do a clean build (or at least change something in main.cpp and then build it again) before you see any differences.
Eclipse setup is pretty fiddly. We're working on ways to make this less painless in the future.
For now, I suggest double-checking all of the items shown in the Project Properties from the setup guide:
https://esp-idf.readthedocs.io/en/lates ... properties
Particularly if the "CDT GCC Build Output Parser" setting is wrong then it's possible CDT is only correctly indexing C files, not C++ files, to find their header paths.
After changing these settings you may need to do a clean build (or at least change something in main.cpp and then build it again) before you see any differences.
Re: C++ and Eclipse woes
Hi kolos,
Turns out there was a bug in the build output for C++ which broke Eclipse CDT parsing. The IDF master branch now has the fix, if you update these warnings should go away.
Reference: https://github.com/espressif/esp-idf/pull/1474
Angus
Turns out there was a bug in the build output for C++ which broke Eclipse CDT parsing. The IDF master branch now has the fix, if you update these warnings should go away.
Reference: https://github.com/espressif/esp-idf/pull/1474
Angus
Re: C++ and Eclipse woes
I discoverd that the -std=c++11 compiler flag is missing. Add this to (i belive)cool.kolos wrote:Dear ESP wizards,
I'm really excited to have some fun with ESP32, but so far I've gotten bogged down with the environment setup. By using official "Get Started" guide and a lot of try and error I've managed to convince Eclipse to build a "hello world" example C file without any problems and errors. However since I'm far more versed in C++, I thought I'd start with that before moving to C.
So I've modified the preprocessor compiler setting as stated in the Kolban book, changed the hello world file form main.c to main.cpp and added: extern "C" { int app_main(void); } at the begging. The result is that the project gets build without a hitch, but now those pesky "unresolved inclusion" errors are back! Grrr...
Any ideas how can I make them go away for good?
Thanks!
and the errors will go away.Command to get compiler specs
Who is online
Users browsing this forum: No registered users and 126 guests