Page 5 of 5

Re: Programming in C++

Posted: Tue Mar 27, 2018 8:52 pm
by kolban
Read the very next post from ESP_iggr ... here is what it said:
The fact that -lstdc++ has to be explicitly added to build flags is a bug, and is on the list to be fixed pre-1.0. (Just adding a flag is not fully sufficient, though. There's a bit more to this).
We also need to look at the date of this thread ... 2016 ... the ESP32 was just newly released and EVERYTHING was beta. I'll edit the post and flag that one shouldn't take everything that was said in olden days as still being applicable.

Re: Programming in C++

Posted: Tue Mar 27, 2018 9:20 pm
by mzimmers
Oh pshaw...the next thing you'll be telling me is that Eisenhower's out of office...

Cool stuff. I have to say I'm impressed so far with this little device. Now to get sockets working...

Re: Programming in C++

Posted: Wed Apr 04, 2018 8:14 am
by ramsay
Hi, I need help on converting arduno esp32 library to use in esp-idf. I want to use touch ic which uses i2c .

Re: Programming in C++

Posted: Mon Sep 03, 2018 9:09 pm
by RA5040
I have built and run a couple of small C++ applications following Neil Kolgan's tutorial ... seems to work fine. However, looking at this thread it's not clear to me how solid the C++/esp-idf environment is at this point. Is it solid enough for serious development, or is it still a work in progress?

I have quite a bit of code written in Arduino using the Eclipse Arduino plugin and I would like to convert over to C++ to get over some of the limitations of Eclipse Arduino (for instance JTAG debugging is very limited compared to debugging in C++ ... not sure of the reason at this stage).

I've tried to include the Arduino code as a component, but I have build errors and haven't had any luck getting help with it ... so at this point I'm thinking of biting the bullet and converting the code manually. But I'm a bit worried that I will end up doing a lot of work only to find that there are still issues with the C++ environment.

Re: Programming in C++

Posted: Tue Mar 05, 2019 6:16 pm
by arnold.braun@gmx.de
You are very generous if you say c++ is working so far. :roll:

Re: Programming in C++

Posted: Tue Mar 05, 2019 9:53 pm
by permal
I have built and run a couple of small C++ applications following Neil Kolgan's tutorial ... seems to work fine. However, looking at this thread it's not clear to me how solid the C++/esp-idf environment is at this point. Is it solid enough for serious development, or is it still a work in progress?

I have quite a bit of code written in Arduino using the Eclipse Arduino plugin and I would like to convert over to C++ to get over some of the limitations of Eclipse Arduino (for instance JTAG debugging is very limited compared to debugging in C++ ... not sure of the reason at this stage).

I've tried to include the Arduino code as a component, but I have build errors and haven't had any luck getting help with it ... so at this point I'm thinking of biting the bullet and converting the code manually. But I'm a bit worried that I will end up doing a lot of work only to find that there are still issues with the C++ environment.
C++ is absolutely viable for ESP32 at this point. I use it exclusively in my project. If you want an example, have a look at my abstraction layer for IDF: https://github.com/PerMalmberg/Smooth (it is undergoing some changes atm that requires a temporary fork of IDF, FYI). Also check my G3 repo, it uses Smooth as its base.

It must be said that IDF is written in C, so it's not that you get a lot of ready to use classes just because you "switch to C++" I fact, you likely get less help than with the arduino platform, unless they can be easily brought over.

That said, the compilers for C++ that Espressif ships are very capable. There is also a new v8 of xtensa-gcc coming so that'll make it even better.

Re: Programming in C++

Posted: Thu Mar 21, 2019 4:18 pm
by grimravus@gmail.com
permal,
I really like what it looks like you're doing in Smooth -- I've been trying to use it for the past few weeks, but my learning curve was pretty steep. I've got decades worth of experience as a developer, but mostly in the Microsoft world, and my last serious effort was a decade ago. Because of that, I have not used CMake before, and I'm new to Github -- so I'm finding your use of CMake in Smooth to be dauntingly sophisticated. Also, you kind of lost me right at the end of your instructions for Smooth. I've got it set up on a Linux VM, using VSCode as my development environment. Is there any chance you could give me some guidance getting started with it?

Grimravus

Re: Programming in C++

Posted: Fri Mar 22, 2019 7:55 am
by permal
permal,
I really like what it looks like you're doing in Smooth -- I've been trying to use it for the past few weeks, but my learning curve was pretty steep. I've got decades worth of experience as a developer, but mostly in the Microsoft world, and my last serious effort was a decade ago. Because of that, I have not used CMake before, and I'm new to Github -- so I'm finding your use of CMake in Smooth to be dauntingly sophisticated. Also, you kind of lost me right at the end of your instructions for Smooth. I've got it set up on a Linux VM, using VSCode as my development environment. Is there any chance you could give me some guidance getting started with it?

Grimravus
Absolutely. Just let me know what the difficulty is and I'll update the instructions. I suggest you file an issue on GitHub. FYI I've just switched back to CLion since the CMake integration there works near-perfectly.

Re: Programming in C++

Posted: Mon Dec 21, 2020 11:57 am
by eldadcicc
Hi,

I have existing long code in C written by esp-idf with eclipse and the ESP32 works fine.
I got recommendation of using a BMX160 library in C++ for Arduino ESP32.
here: https://github.com/DFRobot/DFRobot_BMX160

Can you help me and advise me how to use this C++ arduino library code with my existing C esp-idf code ?