Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++11 support #9

Open
bmitov opened this issue Nov 22, 2024 · 6 comments
Open

C++11 support #9

bmitov opened this issue Nov 22, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@bmitov
Copy link

bmitov commented Nov 22, 2024

How to enable C++11 support?
I am unable to compile modern libraries that require the C++11 features such as class member initialization :-( .

With best regards,
Boian Mitov

@Andy4495 Andy4495 self-assigned this Nov 24, 2024
@Andy4495 Andy4495 added the enhancement New feature or request label Nov 24, 2024
@Andy4495
Copy link
Owner

This will take a little work, and I probably won't start working on it for a couple weeks. I think it is more than just changing the compiler version; there are probably some library and configuration updates in the platform core needed as well.

@bmitov
Copy link
Author

bmitov commented Nov 24, 2024

Thank you! Sounds fantastic! :-)
Please post here the progress, and if you encounter any problems. I will try to help if I can with some library changes or something.

@tcpipchip
Copy link

This is fantastic!
I hope you can add it soon!
Thank you!

@RonsTek
Copy link

RonsTek commented Nov 26, 2024

I would also like to be added, please if possible add it soon. Thank you

@finnandreh
Copy link

Hope you can add it very soon, i would appreciate it very much. Thank you :)

@Rafal123456789987564
Copy link

Allso i Ask GPT To enable C++11 support, but didn't work. Can you add some modification please for platform's please?

Here is GPT answer

follow these steps based on your development environment:

For Arduino IDE:

  1. Open the Arduino installation folder.

  2. Navigate to the hardware directory.

  3. Locate the platform.txt file for the board you are using. For example:

For the ESP32: hardware/espressif/esp32/platform.txt

  1. Open platform.txt in a text editor.

  2. Look for a line starting with compiler.cpp.flags.

  3. Add -std=gnu++11 or -std=c++11 to the list of flags. For example:

compiler.cpp.flags=-std=gnu++11 -fno-exceptions -fno-rtti ...

  1. Save the file and restart the Arduino IDE.

For PlatformIO:

  1. Open the platformio.ini file in your project.

  2. Add the following line under the environment for your board:

build_flags = -std=gnu++11

  1. Save the file and build the project again.

For Other IDEs (e.g., Visual Studio, Eclipse):

  1. Go to your project's build settings.

  2. Locate the compiler flags or options for C++.

  3. Add -std=c++11 (or -std=gnu++11 if GNU extensions are needed).

  4. Rebuild the project.

Let me know if this resolves your issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants